From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tom Coogan <nocera@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Inefficient filter order in query plan
Date: Thu, 27 Feb 2014 12:04:17 -0500
Message-ID: <1633.1393520657@sss.pgh.pa.us> (raw)
In-Reply-To: <CAN07wvLhJhWApx2uGiyeOeCMtXjLw8W84vNNxrhcNvLxKjhTdQ@mail.gmail.com>
References: <CAN07wvLhJhWApx2uGiyeOeCMtXjLw8W84vNNxrhcNvLxKjhTdQ@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Tom Coogan <nocera@gmail.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
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, nocera@gmail.com
Subject: Re: Inefficient filter order in query plan
In-Reply-To: <1633.1393520657@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox