Re: Bad Estimate for complex query with JOINS on subselects and OR in where conditions - Mailing list pgsql-general

From Tom Lane
Subject Re: Bad Estimate for complex query with JOINS on subselects and OR in where conditions
Date
Msg-id 9725.1565963088@sss.pgh.pa.us
Whole thread Raw
In response to Bad Estimate for complex query with JOINS on subselects and OR in where conditions  (Peter Grman <peter.grman@gmail.com>)
Responses Re: Bad Estimate for complex query with JOINS on subselects and OR inwhere conditions
List pgsql-general
Peter Grman <peter.grman@gmail.com> writes:
> our ORM with tenant separation enabled is creating the following query:

Ugh.

By my count there are nine joined tables in that query, which means
you're hitting the default join_collapse_limit.  Increasing that
setting might improve matters somewhat, though it won't fix the
bad rowcount estimate per se.

            regards, tom lane



pgsql-general by date:

Previous
From: Charles Clavadetscher
Date:
Subject: Re: Variable constants ?
Next
From: PegoraroF10
Date:
Subject: Re: slow queries on system tables