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

Possible database optimisations #2834

Open
nitriques opened this issue May 9, 2018 · 2 comments
Open

Possible database optimisations #2834

nitriques opened this issue May 9, 2018 · 2 comments
Assignees
Milestone

Comments

@nitriques
Copy link
Member

Affected Symphony version(s) : 3.0.0
PHP version(s) : all
MySQL version(s): 5.7+
OS(es) : all

There are 3 possible optimisation that can be done on the current 3.0.x codebase.

  1. Convert long or = statements on the same column into in query.
  2. Convert long and != statements on the same column into a not in query.
  3. Optimise sorts using sub-queries, Re Placeholder #657 but I have not found any reasons why to use that since we now run on InnoBD.

Yes/No/Maybe ?

@nitriques nitriques added this to the 4.0.0 milestone May 9, 2018
@nitriques nitriques self-assigned this May 9, 2018
@michael-e
Copy link
Member

Numbers 1 and 2 sound very good to me. I often experienced MySQL being slow especially with OR queries.

Number 3 is unclear to me, are you sure that you linked the correct issue? And how does InnoDB influence this consideration? Is it any better with complicated sorts?

@nitriques
Copy link
Member Author

@michael-e Thanks!

  1. See the commit 6a18bba

And how does InnoDB influence this consideration?

Since it is a new engine, performance can differ. The test made at the time of the commit may longer be true.

Is it any better with complicated sorts?

I've read most of https://dev.mysql.com/doc/refman/5.6/en/statement-optimization.html and they almost never use sub-queries for order by. But again, we would need to benchmark it.

The good news is, we can now, write integration tests to be able to track how our optimisations performs. I would use this framework do to it https://github.com/phpbench/phpbench

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

No branches or pull requests

2 participants