Re: Inefficient filter order in query plan

From: Tom Lane
Subject: Re: Inefficient filter order in query plan
Date: ,
Msg-id: 1633.1393520657@sss.pgh.pa.us
(view: Whole thread, Raw)
In response to: Inefficient filter order in query plan  (Tom Coogan)
Responses: Re: Inefficient filter order in query plan  (Stephen Frost)
Re: Inefficient filter order in query plan  (Tom Coogan)
List: pgsql-performance

Tree view

Inefficient filter order in query plan  (Tom Coogan, )
 Re: Inefficient filter order in query plan  (Tom Lane, )
  Re: Inefficient filter order in query plan  (Stephen Frost, )
   Re: Inefficient filter order in query plan  (Tom Lane, )
  Re: Inefficient filter order in query plan  (Tom Coogan, )
   Re: Inefficient filter order in query plan  (Tom Lane, )
    Re: Inefficient filter order in query plan  (Tom Coogan, )

Tom Coogan <> 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



pgsql-performance by date:

From: Tom Lane
Date:
Subject: Re: Inefficient filter order in query plan
From: Tom Coogan
Date:
Subject: Re: Inefficient filter order in query plan