From: Kynn Jones <kynnjo@gmail.com>
To: Matthew <matthew@flymine.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Q on views and performance
Date: Mon, 25 Feb 2008 11:50:44 -0500
Message-ID: <c2350ba40802250850m2ae1867agbbdc942c3c482d5b@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0802251326010.20402@aragorn.flymine.org>
References: <c2350ba40802221249h37913d0cyaa6387a93c55fe69@mail.gmail.com>
<Pine.LNX.4.64.0802251326010.20402@aragorn.flymine.org>
On Mon, Feb 25, 2008 at 8:45 AM, Matthew <matthew@flymine.org> wrote:
> On Fri, 22 Feb 2008, Kynn Jones wrote:
> > Hi. I'm trying to optimize...
> >
> > (Q1) SELECT a1.word, a2.word
> > FROM T a1 JOIN T a2 USING ( zipk )
> > WHERE a1.type = <int1>
> > AND a2.type = <int2>;
>
> Okay, try this:
>
> Create an index on T(type, zipk), and then CLUSTER on that index...
This is just GREAT!!! It fits the problem to a tee.
Many, many thanks!
Also, including zipk in the index is a really nice extra boost. (If you
hadn't mentioned it I would have just settled for clustering only on
type...)
Thanks for that also!
Kynn
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: kynnjo@gmail.com, matthew@flymine.org
Subject: Re: Q on views and performance
In-Reply-To: <c2350ba40802250850m2ae1867agbbdc942c3c482d5b@mail.gmail.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