Skip to content

Comments

DOC Add section on ORM performance#201

Merged
emteknetnz merged 1 commit intosilverstripe:5from
creative-commoners:pulls/5/orm-performance
Apr 3, 2023
Merged

DOC Add section on ORM performance#201
emteknetnz merged 1 commit intosilverstripe:5from
creative-commoners:pulls/5/orm-performance

Conversation

@GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Apr 3, 2023

This is just a couple of things for now - there are definitely more items that should be added here.

This section was mostly added because I needed a place to put the documentation for silverstripe/silverstripe-framework#10746 - but I bet there are a ton of additional bits and bobs we can document here as well (such as silverstripe/silverstripe-framework#10735 when it's merged)

I've created a separate card to look for other items that should be documented here.

Issue

This is just a couple of things for now - there are definitely more
items that should be added here.
@GuySartorelli GuySartorelli force-pushed the pulls/5/orm-performance branch from 9cb5954 to c048ec9 Compare April 3, 2023 01:57
@emteknetnz emteknetnz merged commit cb7f375 into silverstripe:5 Apr 3, 2023
@emteknetnz emteknetnz deleted the pulls/5/orm-performance branch April 3, 2023 05:47
@emteknetnz
Copy link
Member

emteknetnz commented Apr 3, 2023

@GuySartorelli I probably merged this too soon, for 06_ORM.md could you open a new PR to mention that it'll disable the check and repair for the tables on the entire inheritance chain, both ancestors and descendants

I'm fairly sure that's accurate? I tested it with both

SilverStripe\ORM\Connect\DBSchemaManager:
  exclude_models_from_db_checks:
    - SilverStripe\CMS\Model\SiteTree

and

SilverStripe\ORM\Connect\DBSchemaManager:
  exclude_models_from_db_checks:
    - Page

using a breakpoint on a temporary variable

foreach ($ignoreDataObjects as $ignoreModel) {
    $_dcs = ClassInfo::dataClassesFor($ignoreModel); // <<< break point here

For both configurations it skip the check and repair for the models SiteTree, Page, ErrorPage, etc - implying that the "inheritance chain" goes in both directions

Let me know if I've misunderstood this

@GuySartorelli
Copy link
Member Author

Yup that's correct - the unit test even explicitly ensures that's the case. I'll raise a new PR to add that context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants