Jump to:

3432 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Relation Performance

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 296 Views
  • zenmonkey
    Avatar
    Community Member
    527 Posts

    Relation Performance Link to this post

    Ok I have a performance question. Consider the following

    Page A has many Object B and has Many Object C
    Object B Has One Page A and Has 1 Object C
    Object C Has One Page A and Many Object B

    When I render the page and I need to get the Object B has 1 Object C relation, does it run the relation query for each instance of Object B or does SS already know it has Object C because of the Has Many Relation with the page?

    I know its not a big deal on small numbers, but I worry at how it will scale. Would it be better to cache Object B and Object C and pull the relationship data from that cache or will the extra filter operations cancel any performance gains?

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: Relation Performance Link to this post

    You could maybe check out what happens by adding a ?showqueries=1 to your URL. I often use that in situations like this...

    296 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.