I know N/Hibernate uses a cache to satisfy queries that it has seen before, and that is called a query cache. However, can it satisfy a subset of that query? I'd imagine not since I'd guess that the general problem of figuring that out is undecidable.
Are there any strategies for doing this, though? Say I have a query for all widgets which cost less than $20. Later, I have a query which is for all widgets under $10. Obviously the second query results would be cached already (assuming no evictions, etc.), so I'd like to just reevaluate the predicate against the cached query predicate to determine if it "contains" it. Are there some practical strategies for doing this?