From: | "James Im" <im-james(at)hotmail(dot)com> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: inner join is much faster! is that right? |
Date: | 2006-09-19 13:44:13 |
Message-ID: | BAY7-F27352E5152460F67D8E96896220@phx.gbl |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I was doing the explain thing when I discovered my mistake!
The think is that I over simplyfied my examples. instead of searching
for one ID, I was searching for several ids and I forgot to put a
parentesis arround the or like this.
I was doing this:
select *
from file a, file_tag b, tag c
where a.id_file=b.id_file and b.id_tag=c.id_tag and
a.id_file=10000001000000 or a.id_file=10000001000200
But I should have done this:
select *
from file a, file_tag b, tag c
where a.id_file=b.id_file and b.id_tag=c.id_tag and
(a.id_file=10000001000000 or a.id_file=10000001000200)
This changes everything. The performance is now acceptable!
_________________________________________________________________
Vlg selv hvordan du vil kommunikere - skrift, tale, video eller billeder
med MSN Messenger: http://messenger.msn.dk/ - her kan du det hele
From | Date | Subject | |
---|---|---|---|
Next Message | CG | 2006-09-19 14:46:28 | Nested loops are killing throughput |
Previous Message | Chris Mair | 2006-09-19 12:29:37 | Re: inner join is much faster! is that right? |