Re: Inefficient filter order in query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tom Coogan <nocera(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Inefficient filter order in query plan
Date: 2014-02-27 17:04:17
Message-ID: 1633.1393520657@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Tom Coogan <nocera(at)gmail(dot)com> writes:
> I'd like to understand why PostgreSQL is choosing to filter on the most
> inefficient predicate first in the query below.

It doesn't know that LIKE is any more expensive than the other operators,
so there's no reason to do them in any particular order.

You could try increasing the cost attributed to the texticlike() function
if you don't like the results you're getting here.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephen Frost 2014-02-27 18:24:11 Re: Inefficient filter order in query plan
Previous Message Tom Coogan 2014-02-27 16:57:42 Inefficient filter order in query plan