Search Postgresql Archives
LATERAL query extreme slow due to partition
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Subject
: LATERAL query extreme slow due to partition
From
: Tom Smith <
tomsmith1989sk@xxxxxxxxx
>
Date
: Mon, 7 Sep 2015 01:07:09 -0400
Hi:
I am using the wonderful lateral query feature like the following
select * from generate_series (1,100000,5) T(t),
lateral (select * from P where t between t and t + 3)
P is a parent table of a hundred partitions
the idea is to for each t value from 1 to 100000 with step of 5,
get rows from P (in one or two of its partitions) that between
the current value of t and t+3,
so each lateral select should only index scan one or two partitons
but the query plan shows that each will scan all hundred paritions,
I think due to its unable to determine the range since
the query is select * from P where t between t and t + 3
as "t" is unknown at the time of parsing.
How to force query planner "dynamically" generate plan to
for each lateral select query as "t" changes.
Thanks
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
][
Date Index
][
Thread Index
]
Follow-Ups
:
Re: LATERAL query extreme slow due to partition
From:
Merlin Moncure
Prev by Date:
Re: modify postgresql.conf
Next by Date:
Re: table dependencies
Previous by thread:
modify postgresql.conf
Next by thread:
Re: LATERAL query extreme slow due to partition
Index(es):
Date
Thread
[Index of Archives]
[Postgresql Jobs]
[Postgresql Admin]
[Postgresql Performance]
[Linux Clusters]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[PHP Books]
[PHP Databases]
[Postgresql & PHP]
[Yosemite]