I have complicated query (some joins and ordering), that I want to execute very often. Results of query can change very rarely.

Query gets words form given language and category sorted by frequency, so it have two parameters - language and category.

I heart about materialized views, or databases in memory, bu I do not have experience enough to consider cons and props in reasonable way.

I want to have possibility execute this query for these parameters, and next not execute it until I decide manually, that it must be refreshed. In practice, all application based on executing this query many times, so I do not know if can I create one view in memory, when database use innodb.

I can change mysql on something else, and innodb too if is it recommended.


Let's try the Query cache first. Add these to my.cnf, then restart mysql:

query_cache_type = ON
query_cache_size = 50M

If that does not work adequately, we can discuss alternatives.

  • Your answer was very helpful an I did one step next. But now I have problem with caching query with numeration added after ordering. dba.stackexchange.com/questions/157360/… so we can discuss alternatives :) – Daniel Dec 6 '16 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.