I'm a bit of a performance freak. So if this strikes you as totally
pointless, feel free to ignore me.

 

We've recently switched over to using a more complex DisMax search for
some of our queries. In the process of measuring the performance impact,
I noticed that my Query Cache had grown considerably with these new
Queries. I made sure to use the same data set for before and after
comparisons, and the same query set where I modified the queries to use
the new search (qt=foo). Before, my queries took up an average of 800
bytes. Now they take an average of 3500 bytes. Overall, that will mean I
will hold 75% less queries in my query cache then I used to. And the
query cache is very important for performance.

 

A little digging revealed that the extra memory usage was from the Query
itself held in the cache key, not the results (doc ids). So, my question
is, could we decrease the memory footprint of the queries in the cache,
by *not* holding onto the Query object itself in the cache at all. Could
we turn it into a canonical string that represents the query, and use
that for the key in the cache? I'm assuming that would take up much less
memory, at least in the case that I'm experiencing.

 

Are there any benefits to be had here? Are there huge downsides I'm
missing?

Reply via email to