Re: BUG #6426: Complex query runs 10 times longer with "LIMIT 20"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Schetinin <aschetinin(at)gmail(dot)com>
Cc: Alex Lai <alai(at)sesda2(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6426: Complex query runs 10 times longer with "LIMIT 20"
Date: 2012-02-02 16:40:32
Message-ID: 25499.1328200832@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Andrew Schetinin <aschetinin(at)gmail(dot)com> writes:
> Previously I always thought that the order of JOINs or conditions in WHERE
> is irrelevant, and query optimizer rearranges the order according to its
> logic. Now it appears that sometimes it may be important.

If you have more than join_collapse_limit JOINs in the query, the order
can matter.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2012-02-02 17:04:35 Re: BUG #6407: Crash on queries to gin index with multiply values
Previous Message sephaliii 2012-02-02 14:03:29 BUG #6429: i cannot complete installation due to a forgotten password