Re: Index Scanning - Mailing list pgsql-general

From Richard Huxton
Subject Re: Index Scanning
Date
Msg-id 459B9FCB.1010405@archonet.com
Whole thread Raw
In response to Index Scanning  (Enrico <scotty@linuxtime.it>)
Responses Re: Index Scanning  (Enrico <scotty@linuxtime.it>)
List pgsql-general
Don't forget to cc the list

Enrico wrote:
> On Wed, 03 Jan 2007 10:55:03 +0000
> Richard Huxton <dev@archonet.com> wrote:
>
>> You're fetching all the rows from both tables - what would an index scan
>> gain you
>
> there is a join

Yes, there is a join. Between all the rows in tmp_righe_bolle_carico
(tr) and all the matches in bolle_carico_testata (tb). It looks like
there is one row in (tb) that matches each in (tr).

What do you expect two index scans over both tables would gain you?
You seem to be saying that you think:
   fetching 22420 index entries on tr + fetching 22420 rows in tr
+ fetching 22420 index entries on tb + fetching 22420 rows in tb
+ merge-join
would be faster than the hash-join you've got. I think it's unlikely
that's the case.

If you issue "set enable_seqscan = off" before the query that should
force it to use the indexes first. What does that plan show you?

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: queueing via database table?
Next
From: "hubert depesz lubaczewski"
Date:
Subject: "no unpinned buffers available" ? why? (hstore and plperl involved)