Re: Speeding query

From: Tom Jenkins <tjenkins(at)devis(dot)com>
To: Uros Gruber <uros(at)sir-mag(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Speeding query
Date: 2002-04-25 13:17:29
Message-ID: 1019740649.12165.57.camel@asimov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2002-04-24 at 16:54, Uros Gruber wrote:
>
> select d.title from table1 d, table2 c where c.id_category='09' and d.id_entry=c.id_entry;
>
>
> I see that there is seq scan over 25k rows, how can i set
> indexes to make query faster and use indexes.
>

try setting an index on table2's id_entry. your index on table2 is a
compound index with id_entry as the second field; so no indexes match
just table2's id_entry.
--

Tom Jenkins
Development InfoStructure
http://www.devis.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-04-25 13:25:06 Re: Help with performance
Previous Message Gregory Seidman 2002-04-25 12:41:54 Re: pid gets overwritten in OSX