From: | Teodor Sigaev <teodor(at)sigaev(dot)ru> |
---|---|
To: | pgsql-hackers <pgsql-hackers(at)postgreSQL(dot)org> |
Subject: | index scan over composite type |
Date: | 2018-05-15 19:44:03 |
Message-ID: | a6b22369-e3bf-4d49-f59d-0c41d3551e81@sigaev.ru |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi!
I'm not understand why postgres prefers to sort table instead of using
index only scan when query is a simple inner join on composite type.
Query with equality clause with constant works fine with index scan but
join not. Could somebody point me why? Thank you.
And I'm not able to force merge_join with index scans with any
combination of enable_* variables.
Attached script is a self-contained test script. Pg config file is
default.
explain
select
a.idv, b.idv
from
a, b
where
a.idv = b.idv;
Merge Join (cost=25751.64..27751.64 rows=100000 width=74)
Merge Cond: (a.idv = b.idv)
-> Sort (cost=12875.82..13125.82 rows=100000 width=37)
Sort Key: a.idv
-> Seq Scan on a (cost=0.00..1834.00 rows=100000 width=37)
-> Sort (cost=12875.82..13125.82 rows=100000 width=37)
Sort Key: b.idv
-> Seq Scan on b (cost=0.00..1834.00 rows=100000 width=37)
--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/
Attachment | Content-Type | Size |
---|---|---|
test.sql | application/sql | 439 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2018-05-15 19:44:37 | Re: Postgres 11 release notes |
Previous Message | Bruce Momjian | 2018-05-15 19:37:10 | Re: Postgres 11 release notes |