-
Notifications
You must be signed in to change notification settings - Fork 0
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
Added SQL indexes #124
base: master
Are you sure you want to change the base?
Added SQL indexes #124
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were the indexes added by looking at EXPLAIN of actual queries?
I executed EXPLAIN for some tables but in most cases decisions were made by obvious non-optimized tables with relation, like a table with a field |
@w911 need your input. |
Thanks, Chris
I suppose here he meant the primary keys of the tables themselves. So, it's "the easiest one", so we can skip it)
Only several tables have real foreign keys. So, the fields like {
All those "foreign keys" are needed for: joining other tables, using related tables in GridViews (it means I also added indexes for some fields that are "important" for @samdark Your thoughts about all this? |
That's not good. Also, it's better to add FK and indexes explicitly since only MySQL adds these automatically. PostgreSQL, for example, does not. |
|
For these, instead of adding a generic index, a foreign key should be added explicitly. |
@bohdan-vorona yes I think that is good for adding foreign keys. This is a low priority. |
Whether to allow cascade deletion should be decided for every foreign key. I would not allow it for all in general. |
Ok. |
Not instead. In addition to. Only MySQL adds indexes automatically. Other DBMSes do not. |
Checked all the tables and added SQL indexes where needed.