Re: Trying to get postgres to use an index
От | |
---|---|
Тема | Re: Trying to get postgres to use an index |
Дата | |
Msg-id | 50156.12.134.204.65.1099778485.squirrel@mail.linkify.com обсуждение исходный текст |
Ответ на | Re: Trying to get postgres to use an index (Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>) |
Список | pgsql-general |
> Well, you're joining the entire two tables, so yes, the seq scan might > be faster. My mistake. When composing the email to state the problem, I accidentally gave a wrong versionof the join query. Here is the corrected version, which still has the sequential scan... explain select notificationID from NOTIFICATION n, ITEM i where n.itemID = i.itemID andi.projectID = 12; QUERY PLAN -------------------------------------------------------------------------------------------------- Hash Join (cost=2237.54..15382.32 rows=271 width=44) Hash Cond: ("outer".itemid = "inner".itemid) -> Seq Scan on notification n (cost=0.00..12023.71 rows=223671 width=48) -> Hash (cost=2235.31..2235.31 rows=895 width=4) -> Index Scan using item_ix_item_4_idx on item i (cost=0.00..2235.31 rows=895width=4) Index Cond: (projectid = 12)
В списке pgsql-general по дате отправления: