From: Richard Huxton <dev@archonet.com>
To: Adam Gundy <adam@starsilk.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: varchar index joins not working?
Date: Mon, 14 Apr 2008 18:54:20 +0100
Message-ID: <48039A4C.2000304@archonet.com> (raw)
In-Reply-To: <48038E21.50606@starsilk.net>
References: <6f55f1270804092013n73ee1f81t2c6d72cee49655a3@mail.gmail.com>
<47FDD3D1.9070208@archonet.com>
<47FE29AF.6010906@starsilk.net>
<6f55f1270804101154t3d4a01eco2b7bff7a0053af38@mail.gmail.com>
<48030439.9040309@archonet.com>
<48038E21.50606@starsilk.net>
Adam Gundy wrote:
> I doubt we could get stats stable enough for this. the number of groups
> will hopefully be much larger at some point.
The pg_stats table should be recording the n most-common values, so if
you have 1 million groups you track details of the 1000 most-common.
That gives you a maximum for how common any value not in the stats can be.
>> No, but let's see what's in pg_stats.
>
> no real help there. either it hits the group being read, and does a good
> plan, or it doesn't, and tries to seqscan (unless I disable it). even
> forcing stats to 1000 only bandaids the situation, given the number of
> groups will eventually exceed that..
Like I say, that's not the point of gathering the stats. If one group
represents 95% of your rows, then its group-id should be almost certain
to occur in the stats. Are you saying that's not happening with your data?
--
Richard Huxton
Archonet Ltd
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: dev@archonet.com, adam@starsilk.net
Subject: Re: varchar index joins not working?
In-Reply-To: <48039A4C.2000304@archonet.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