MetaMatrix produces an inefficient query plan when using multiple values in an IN clause.

Solution Verified - Updated -


  • Hibernate routinely generates queries with large IN clauses to lookup entities by ID. These queries are machine-generated, not written by hand.
  • We find that the query plan generated by MetaMatrix is efficient when we use a single value in an IN clause. However, we find that the query plan fails to eliminate an expensive side of the query, and is inefficient, when more than one value is specified in the IN clause.

  • The query planner should be able to eliminate the expensive side of the query in both cases, and avoid executing an expensive operation that will always equate to null.


  • MetaMatrix Enterprise Server 5.5.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content