Need help/advice with this concept. I have pretty complex fluent query which pulls rows according to users filters.
I was thinking of making unfiltered (only joins, without where/whereIns) query which would be cached, and then somehow filter that cached query according to users need.
There's 2-3 seconds lag when querying db each time form filter changes, so i'm guessing this can perform better.
Now unfiltered query is around 5k rows, and average filtered one brings 500-1000 rows.
Query is around 25 columns with 4 CONCATS, 3 CASE statements and 14 leftJoins.
Is that right way? Any other suggestions?
Thanks in advance!
Y
Maybe you can use sql view.
Or you can store your filtered data to another database table. And you can update it using a trigger automatically.
By the way you can filter your data fastly from database table using sql.
It will be like dbcache, but you will control it.