Re: [SQL] indexes - Mailing list pgsql-sql

From Remigiusz Sokolowski
Subject Re: [SQL] indexes
Date
Msg-id Pine.GS4.4.02A.9905311102450.26326-100000@netra.gdansk.sprint.pl
Whole thread Raw
In response to Re: [SQL] indexes  (Vadim Mikheev <vadim@krs.ru>)
List pgsql-sql
> > Hi!
> > I try to optimize following query
> > SELECT DISTINCT e1.name_ent AS nazwa_grupy
> > FROM ent e1, binds b1, ent e2
> > WHERE e1.id_ent=b1.id_parent AND b1.id_child=e2.id_ent AND b1.id_links=0
> > AND e2.name_ent='SERWIS';
> > 
> > Table    = binds2_idx
> > +--------------------+----------------------------------+------+
> > |Field               |              Type                |Length|
> > +--------------------+----------------------------------+------+
> > | id_parent          | int4                             |4     |
> > | id_child           | int4                             |4     |
> > | id_links           | int4                             |4     |
> > +--------------------+----------------------------------+------+
> 
> Try to create index on binds (id_links, id_parent, id_child)
> 
> Vadim

Wow - works great - big thanks!
Could You throw some hints - why index should look like as You wrote?
I looked in docs, but there is no clues how to build indices (or I just
didn't find them)Thanks once more :-)Rem
-------------------------------------------------------------------*------------
Remigiusz Sokolowski      e-mail: rems@gdansk.sprint.pl           * *        
-----------------------------------------------------------------*****----------




pgsql-sql by date:

Previous
From: Vadim Mikheev
Date:
Subject: Re: [SQL] indexes
Next
From: Vadim Mikheev
Date:
Subject: Re: [SQL] indexes