From: Nick Fankhauser <nickf@ontko.com>
To: Frank Bax <fbax@sympatico.ca>
To: pgsql-sql@postgresql.org
To: Guru\(External\) <guru@indvalley.com>
Subject: Re: Resources
Date: Fri, 11 Jan 2002 11:56:08 -0500
Message-ID: <NEBBLAAHGLEEPCGOBHDGEEOKECAA.nickf@ontko.com> (raw)
In-Reply-To: <3.0.6.32.20020111112758.01d7feb0@pop6.sympatico.ca>
> Sorry, I made too general a statement. Index will help when the expession
...and I didn't notice that Gurudutt's LIKE wasn't anchored to the front.
oops- mea culpa.
Taking a second look then, the LIKE is probably very costly.
Take a look at the section in the Docs on making explicit joins. If the date
check significantly constrains the results, index it & then make sure that
constraint gets evaluated first, then the sequential scan on the address has
less to scan. This might help a lot.
The doc page for explicit joins:
http://www.postgresql.org/idocs/index.php?explicit-joins.html
You mention that it may be too late to change the tables, but I guess that's
where I'd look next- I once had a similar situation when I worked for an
electric utility & we ended up parsing the address lines to find road names
& numbers and then loading them into special indexed fields just used for
sorting. If you control the input app, maybe you could even have the user
enter the fields you want to query on separately.
-Nick
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-sql@postgresql.org
Cc: nickf@ontko.com, fbax@sympatico.ca, guru@indvalley.com
Subject: Re: Resources
In-Reply-To: <NEBBLAAHGLEEPCGOBHDGEEOKECAA.nickf@ontko.com>
* 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