Re: [HACKERS] Why is that so slow? - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: [HACKERS] Why is that so slow?
Date
Msg-id 199903050537.OAA02917@srapc451.sra.co.jp
Whole thread Raw
In response to Why is that so slow?  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: [HACKERS] Why is that so slow?
List pgsql-hackers
I got a good suggestion from Hiroshi. The conclusion is:

>    pid int2,        -- has an btree index

This is bad. I had defined a btree index on pid and it has 2000
duplicate entries in average! After I removed the index, the query
runs unbelievably fast! Now explain shows:

Nested Loop  (cost=933.82 size=1 width=100) ->  Index Scan using cityindex on postal  (cost=931.77 size=1 width=74) ->
IndexScan using prefpidindex on prefecture  (cost=2.05 size=47 width=26)
 

--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Why is that so slow?
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [INTERFACES] Foreign Keys