From: jdassen@cistron.nl
To: pgsql-sql@postgresql.org
Subject: Re: index/join madness
Date: Wed, 23 May 2001 14:02:09 +0000 (UTC)
Message-ID: <slrn9gngn1.oth.jdassen@odin.cistron-office.nl> (raw)
References: <3B0B4776.0001A9.50190@frodo.searchcanada.ca>
Michael Richards <michael@fastmail.ca> wrote:
> Ok, I've built the most insane query ever.
Indeed. Kindly stay away from sharp objects and wait for the friendly people
to bring you to the bouncy room :-)
> If anyone has a screen wide enough to see this, you will see that the
> majority of the time is spent doing sequential scans on the formdata
> table. This table needs formid, fieldid and userid to find the value I'm
> looking for.
> In my case I'm ignoring occid since it's always 1 for these values.
What happens if you put in an "and occid = 1"? Perhaps it's the case that
you know it's always one, but the query planner doesn't realise this.
> I'm a little curious as to why it's not using the primary key...
Another possible cause which I've seen in a couple of recent threads is that
the query analyzer isn't very smart about the relationships between types,
so it may help to explicitly cast values to the exact type used in the
index.
HTH,
Ray
--
"Never trust a poll you haven't rigged yourself."
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-sql@postgresql.org
Cc: jdassen@cistron.nl
Subject: Re: index/join madness
In-Reply-To: <slrn9gngn1.oth.jdassen@odin.cistron-office.nl>
References: <3B0B4776.0001A9.50190@frodo.searchcanada.ca> <slrn9gngn1.oth.jdassen@odin.cistron-office.nl>
* 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