Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set relations indexes to be multi column indexes #5602

Merged
merged 1 commit into from
Jul 28, 2016
Merged

Set relations indexes to be multi column indexes #5602

merged 1 commit into from
Jul 28, 2016

Conversation

SvanteRichter
Copy link
Contributor

@SvanteRichter SvanteRichter commented Jul 28, 2016

Because any query with from_contenttype will include from_id and the same with to_*. Gives a very nice performance boost when dealing with sites that have a large amount of relations.

Before:

SELECT * FROM bolt_relations WHERE from_contenttype=? AND from_id IN (?) ORDER BY id 
Parameters: ["kommentarer",{"681786":"681786"}] 
Time: 371.70 ms

After:

SELECT * FROM bolt_relations WHERE from_contenttype=? AND from_id IN (?) ORDER BY id 
Parameters: ["kommentarer",{"681786":"681786"}] 
Time: 0.33 ms

@GwendolenLynch
Copy link
Contributor

Seriously … who the heck set up those indexes … 🐨 🔫

@SvanteRichter
Copy link
Contributor Author

SvanteRichter commented Jul 28, 2016

~~Oh, and just like #5597 this will need an update to the tests db, so it will fail the tests (but lets let them run so we see that is the only failure it gets).~~~

Updated db file, I thought there was some 🐨 magic process to do it and therefore didn't include it at first.

Because any query with from_contenttype will include from_id and the
same with to_*
@GwendolenLynch GwendolenLynch merged commit 51f2168 into bolt:release/3.0 Jul 28, 2016
@GwendolenLynch
Copy link
Contributor

:shipit:

@SvanteRichter SvanteRichter deleted the multi-col-index-relations branch August 9, 2016 16:02
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