Skip site navigation (1) Skip section navigation (2)

Re: Q on views and performance

From: "Kynn Jones" <kynnjo(at)gmail(dot)com>
To: Matthew <matthew(at)flymine(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Q on views and performance
Date: 2008-02-25 16:50:44
Message-ID: c2350ba40802250850m2ae1867agbbdc942c3c482d5b@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Mon, Feb 25, 2008 at 8:45 AM, Matthew <matthew(at)flymine(dot)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

In response to

Responses

pgsql-performance by date

Next:From: MatthewDate: 2008-02-25 16:56:32
Subject: Re: Q on views and performance
Previous:From: Joel StevensonDate: 2008-02-25 16:48:20
Subject: Re: LISTEN / NOTIFY performance in 8.3

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group