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

Re: Index not used in join.. (example included)

From: Ron Arts <ron(dot)arts(at)neonova(dot)nl>
To: Michael Wood <esiotrot(at)gmail(dot)com>
Cc: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Index not used in join.. (example included)
Date: 2009-09-18 13:15:15
Message-ID: 4AB387E3.7010707@neonova.nl (view raw or flat)
Thread:
Lists: pgsql-novice
Michael Wood schreef:
> 2009/9/18 Michael Wood <esiotrot(at)gmail(dot)com>:
>> 2009/9/18 Ron Arts <ron(dot)arts(at)neonova(dot)nl>:
>>> A. Kretschmer schreef:
>> [...]
>>>> You can try to force an index-scan by disabling the seq-scan (set
>>>> enable_seqscan='no';) and re-run the query.
>>> That does force it to use the index, but doesn't speed up my query.
>> Would it help to add an index on the name column of the detail table?
>> And maybe to make it a foreign key referencing the first table?
> 
> Sorry, I just had another look and see you do have an index on the
> name column in detail.
> 
> I wonder if it would make a difference if the index on the first table
> was a unique index.
> 
> --
> Michael Wood <esiotrot(at)gmail(dot)com>
> 

Well, the name columns are not unique in both tables. So I cannot make it
an unique index.

Ron

-- 
NeoNova BV
innovatieve internetoplossingen

http://www.neonova.nl  Science Park 140           1098 XG Amsterdam
info: 020-5611300      servicedesk: 020-5611302   fax: 020-5611301
KvK Amsterdam 34151241

Op dit bericht is de volgende disclaimer van toepassing:
http://www.neonova.nl/maildisclaimer

In response to

pgsql-novice by date

Next:From: Tom LaneDate: 2009-09-18 14:10:50
Subject: Re: Index not used in join.. (example included)
Previous:From: Michael WoodDate: 2009-09-18 12:41:09
Subject: Re: Index not used in join.. (example included)

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