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

Optimise queries #31

Merged
merged 4 commits into from
May 11, 2018
Merged

Optimise queries #31

merged 4 commits into from
May 11, 2018

Conversation

hauleth
Copy link
Contributor

@hauleth hauleth commented Apr 26, 2018

This is overall review of the DB status. More details in commit messages.

@hauleth hauleth changed the title WIP: Optimise queries Optimise queries Apr 26, 2018
@hauleth
Copy link
Contributor Author

hauleth commented Apr 27, 2018

It seems that there is race condition in test suite which causes the problems with build passing.

@hauleth hauleth force-pushed the optimise-queries branch 2 times, most recently from 566118d to cfd0b4f Compare April 30, 2018 14:34
@hauleth
Copy link
Contributor Author

hauleth commented May 1, 2018

It will be hard for me to increase coverage in this PR as the decrease is due to fact that I have removed bunch of lines and that caused overall coverage fall, each separate file coverage is left as is.

.tool-versions Outdated
@@ -0,0 +1 @@
elixir 1.6.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be commited since we can’t assume what the developer will use to manage elixir and erlang dependancies.

Inner join is default join for Ecto for valid reasons, it helps DB
optimizer to reduce amount of tuples fetched from storage.
A lot of indices through whole DB were missing. While some of them are
overlapping with existing mutlicolumn indices the order of columns is
wrong, as most specific ones are first and least specific (and by that
most used) are last which mean that DB cannot use them in queries.
Trigram indices are built-in extension to PostgreSQL which greatly
improve non-contextual text search queries where search query is longer
than 3 characters by building index of 3 characters blocks in each
entry.  As this is built-in this do not require any additional
installation.
Old way required 2 DB queries, where one would be sufficient.
@hauleth
Copy link
Contributor Author

hauleth commented May 7, 2018

All requests resolved.

@simonprev simonprev merged commit fd1499a into mirego:master May 11, 2018
@hauleth hauleth deleted the optimise-queries branch May 11, 2018 12:18
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.

None yet

2 participants