From: Dave Cramer <pg@fastcrypt.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Why the difference in plans ?
Date: Fri, 7 Mar 2008 06:21:03 -0500
Message-ID: <5AA2522A-E359-4BA2-871C-5C5EA718F31F@fastcrypt.com> (raw)
In-Reply-To: <200803060926.38708.josh@agliodbs.com>
References: <E0CF6B25-5191-4AF7-8C72-E67FA2F1AE5E@fastcrypt.com>
<200803060926.38708.josh@agliodbs.com>
Josh,
On 6-Mar-08, at 12:26 PM, Josh Berkus wrote:
> Dave,
>
>> Below I have two almost identical queries. Strangely enough the one
>> that uses the index is slower ???
>
> My first guess would be that records are highly correlated by DOB
> and not at
> all by name. However, it would help if you supplied both the index
> definitions and what changed between the two queries to cause the
> index to be
> used.
Indexes:
"user_profile_pkey" PRIMARY KEY, btree (uid) CLUSTER
"user_profile_name_idx" UNIQUE, btree (name varchar_pattern_ops)
"user_profile_name_key" UNIQUE, btree (name)
"user_profile_uploadcode_key" UNIQUE, btree (uploadcode)
"user_profile_active_idx" btree (isactive)
"user_profile_areacode_index" btree (areacode)
"user_profile_gender_idx" btree (gender)
and nothing changed between runs.
Dave
>
>
> --
> Josh Berkus
> PostgreSQL @ Sun
> San Francisco
>
> --
> Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org
> )
> To make changes to your subscription:
> http://mail.postgresql.org/mj/mj_wwwusr?domain=postgresql.org&extra=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 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-performance@postgresql.org
Cc: pg@fastcrypt.com, josh@agliodbs.com
Subject: Re: Why the difference in plans ?
In-Reply-To: <5AA2522A-E359-4BA2-871C-5C5EA718F31F@fastcrypt.com>
References: <E0CF6B25-5191-4AF7-8C72-E67FA2F1AE5E@fastcrypt.com> <200803060926.38708.josh@agliodbs.com> <5AA2522A-E359-4BA2-871C-5C5EA718F31F@fastcrypt.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