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

Avoid unnecessary information in query hints to improve query cache hit ratio #8797

Merged
merged 2 commits into from
Feb 15, 2023

Commits on Feb 8, 2023

  1. Avoid unnecessary information in query hints to improve query cache h…

    …it ratio
    
    I've noticed that over time my query caches fill up with redundant queries, i. e. different cache entries for the DQL -> SQL translation that are exactly the same. For me, it's an issue because the cache entries fill up precious OPcache memory.
    
    Further investigation revealed that the queries themselves do not differ, but only the query hints – that are part of the computed cache key – do.
    
    In particular, only the value for the `WhereInWalker::HINT_PAGINATOR_ID_COUNT` query hint are different. Since `WhereInWalker` only needs to know _if_ there are matching IDs but not _how many_, we could avoid such cache misses by using just a boolean value as cache hint.
    mpdude committed Feb 8, 2023
    Configuration menu
    Copy the full SHA
    660197e View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2023

  1. Write a test in a more specific way

    ... so we can be sure that in fact the second result has a different size.
    
    Co-authored-by: Luís Cobucci <lcobucci@gmail.com>
    mpdude and lcobucci committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    29bc6cc View commit details
    Browse the repository at this point in the history