From: Nick Howden <n.howden@eris.qinetiq.com>
To: pgsql-admin@postgresql.org
Subject: Is is possible to persuade the query planner that ~* operations are grossly expensive?
Date: Tue, 17 Dec 2002 09:22:17 +0000
Message-ID: <20021217092705.9AC8F476281@postgresql.org> (raw)
Is is possible to persuade the query planner that ~* operations are grossly
expensive - or at least much more expensive than some other operations.
My reason is that I have a databsase on which we do a lot of queries of the
form
SELECT
*
FROM
primary_table
secondary_table as t1
secondary_table as t2
WHERE primary_table.id = t1.id
AND primary_table.id = t2.id
AND t1.col1 = 1
AND t2.col1 = 2
AND primary_table.blob ~* 'wibble';
unfortunately the query optimiser always tries to do the ~* operator before
it has done the other (more selective) queries, and over 100,000+ rows this
is very slow.
So, can I force the query optimizer to delay doing the ~* until after the
selective joins?
--
Nick Howden - Senior IT Analyst
QinetiQ Trusted Information Management
Woodward Building, Room B009
Malvern Technology Park, WR14 3PS
Telephone 01684 895566, Fax 896660
The Information contained in this E-Mail and any subsequent correspondence
is private and is intended solely for the intended recipient(s).
For those other than the recipient any disclosure, copying, distribution,
or any action taken or omitted to be taken in reliance on such information is
prohibited and may be unlawful
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: n.howden@eris.qinetiq.com
Subject: Re: Is is possible to persuade the query planner that ~* operations are grossly expensive?
In-Reply-To: <20021217092705.9AC8F476281@postgresql.org>
References: <20021217092705.9AC8F476281@postgresql.org>
* 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