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

Solution Verified - Updated -

Issue

  • 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.

Environment

  • MetaMatrix Enterprise Server 5.5.4

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.