Re: sub-select in IN clause results in sequential scan
От | Anj Adu |
---|---|
Тема | Re: sub-select in IN clause results in sequential scan |
Дата | |
Msg-id | f2fd819a0910290710i324b153fxeb0b01ceb7831083@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: sub-select in IN clause results in sequential scan (Angayarkanni <kangayarkanni@gmail.com>) |
Ответы |
Re: sub-select in IN clause results in sequential scan
Re: sub-select in IN clause results in sequential scan |
Список | pgsql-performance |
Join did not help. A sequential scan is still being done. The hardcoded value in the IN clause performs the best. The time difference is more than an order of magnitude. 2009/10/29 Angayarkanni <kangayarkanni@gmail.com>: > > 2009/10/29 Grzegorz Jaśkiewicz <gryzman@gmail.com> >> >> >> On Wed, Oct 28, 2009 at 6:13 PM, Anj Adu <fotographs@gmail.com> wrote: >>> >>> Postgres consistently does a sequential scan on the child partitions >>> for this query >>> >>> select * from partitioned_table >>> where partitioned_column > current_timestamp - interval 8 days >>> where x in (select yy from z where colname like 'aaa%') >>> >>> If I replace the query with >>> >>> select * from partitioned_table >>> where partitioned_column > current_timestamp - interval 8 days >>> where x in (hardcode_value) >>> >>> The results are in line with expectation (very fast and uses a Bitmap >>> Index Scan on the column X) >>> \ >> >> use JOIN luke.. >> >> -- >> GJ > > Yes you try by using Join > > JAK >
В списке pgsql-performance по дате отправления: