On 4/11/2024 15:23, Stepan Yankevych wrote:
Let's classify it as possible improvement / new feature for further
releases.
Optimizer definitely should be able to add that extra (redundant)
condition *and e.exec_date_id >= 20241021*
or even transform* e.exec_date_id >= co.create_date_id *
to
1021
Stepan Yankevych
From: Andrei Lepikhov
Sent: Sunday, November 3, 2024 4:42 AM
To: Vijaykumar Jain ; Stepan Yankevych
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Postgresql 14/15/16/17 partition pruning on dependent table during
join
On 3
On 3/11/2024 03:21, Vijaykumar Jain wrote:
On Fri, 1 Nov 2024 at 18:51, Stepan Yankevych wrote:
Partition pruning is not pushing predicate into dependent table during join in
some cases.
See example. Predicate highlighted in red
i think your observation is correct.
you may need to provide
On Fri, 1 Nov 2024 at 18:51, Stepan Yankevych wrote:
>
> Partition pruning is not pushing predicate into dependent table during join
> in some cases.
> See example. Predicate highlighted in red
>
i think your observation is correct.
you may need to provide redundant predicate
Partition pruning is not pushing predicate into dependent table during join in
some cases.
See example. Predicate highlighted in red
explain select *
from public.orders co
left join public.execution e on e.order_id = co.order_id and e.exec_date_id >=
co.create_date_id
where co.order_text
Aggregate
-> Seq Scan on tbl1 tbl
Filter: (tenant_id = ANY ('{1}'::integer[]))
Sadly I can't make tenants() immutable because it's a runtime setting, and
making tenants() STABLE does not lead to partition pruning with or without
the
US 2, REMAINDER 0);CREATE
TABLE tbl2 PARTITION OF tbl FOR VALUES WITH (MODULUS 2, REMAINDER 1);INSERT
INTO tbl (tenant_id, some_col) SELECT 1, * FROM
generate_series(1,1);INSERT INTO tbl (tenant_id, some_col) SELECT 3, *
FROM generate_series(1,10000);*
Partition pruning works as expected for
at can be accommodated easily with a
>> "timestamp" data type.
>>
>> However the question we have is ,
>> *1)If there is any downside of having the partition key with "timestamp
>> with timezone" type? Will it impact the partition pruning of the queri
l-performance@lists.postgresql.org
Subject: Re: partition pruning only works for select but update
Justin Pryzby writes:
> On Fri, Jul 01, 2022 at 08:30:40AM +, James Pang (chaolpan) wrote:
>> We have other application depend on V13, possible to backport code
>> changes to V13 as
>> ht
Justin Pryzby writes:
> On Fri, Jul 01, 2022 at 08:30:40AM +, James Pang (chaolpan) wrote:
>> We have other application depend on V13, possible to backport code changes
>> to V13 as
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=86dc90056dfdbd9d1b891718d2e5614e3e432f35
> I
> Sent: Tuesday, June 28, 2022 9:30 PM
> To: James Pang (chaolpan)
> Cc: pgsql-performance@lists.postgresql.org
> Subject: Re: partition pruning only works for select but update
>
> "James Pang (chaolpan)" writes:
> > But when
> > Explain update tab
Pang (chaolpan)
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: partition pruning only works for select but update
"James Pang (chaolpan)" writes:
> But when
> Explain update table set .. where partitionkey between to_timestamp() and
> to_timestamp();
>
For release v14, optimizer can handle large partition counts query ( select
,update ,delete) and partition pruning is similar as SELECT, right? We will
check option to upgrade to v14.
Thanks,
James
-Original Message-
From: Tom Lane
Sent: Tuesday, June 28, 2022 9:30 PM
To: James
"James Pang (chaolpan)" writes:
> But when
> Explain update table set .. where partitionkey between to_timestamp() and
> to_timestamp();
> It still show all of partitions with update ...
In releases before v14, partition pruning is far stupider for UPDATE
(and DELETE)
Hi,
We have a table have range partition (about 5K partitions) , when
Explain select count(*) from table where partitionkey between to_timestamp()
and to_timestamp();
It show
Aggregate (cost=15594.72..15594.73 rows=1 width=8)
-> Append (cost=0.15..15582.00 rows=5088 width=0)
Sub
e this is understandable, English is not my
native language 😉).
Regards,
Sigrid
-Original Message-
From: David Rowley
Sent: Wednesday, November 4, 2020 9:13 PM
To: Ehrenreich, Sigrid
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Partition pruning with joins
On Wed, 4 Nov 2
51 width=4)
> Filter: ((part_key >= 110) AND (part_key <= 160))
>
>
> I know, that I could get rid of this problem, by rewriting the query to
> include the partitioned table in the where clause like this:
> WHERE fact.part_key >= 210 and fact.part_key <=
PM
To: Ehrenreich, Sigrid ;
pgsql-performance@lists.postgresql.org
Subject: Re: Partition pruning with joins
On Tue, 2020-11-03 at 13:20 +, Ehrenreich, Sigrid wrote:
> I would like to join a partitioned table and have the joined columns in the
> where clause to be used for partition p
On Tue, 2020-11-03 at 13:20 +, Ehrenreich, Sigrid wrote:
> I would like to join a partitioned table and have the joined columns in the
> where clause to be used for partition pruning.
> From some readings in the internet, I conclude that this was not possible in
> v12. I h
Hi,
I would like to join a partitioned table and have the joined columns in the
where clause to be used for partition pruning.
From some readings in the internet, I conclude that this was not possible in
v12. I hoped for the “improvements in partition pruning” in v13, but it seems
to me, that
Thanks!
On Mon, Mar 23, 2020 at 12:10 AM Justin Pryzby wrote:
> On Sun, Mar 22, 2020 at 11:45:53PM -0400, Ronnie S wrote:
> > Hello All,
> >
> > While doing some tests with hash partitioning behavior in PG11 and 12, I
> > have found that PG11 is not performing par
On Sun, Mar 22, 2020 at 11:45:53PM -0400, Ronnie S wrote:
> Hello All,
>
> While doing some tests with hash partitioning behavior in PG11 and 12, I
> have found that PG11 is not performing partition pruning with DELETEs
> (explain analyze returned >2000 lines). I then ran the
Hello All,
While doing some tests with hash partitioning behavior in PG11 and 12, I
have found that PG11 is not performing partition pruning with DELETEs
(explain analyze returned >2000 lines). I then ran the same test in PG12
and recreated the objects using the same DDL, and it worked
Here
oo.foo_id
> where foo.foo_name = 'eeny'
>
> I do see an "Index Only Scan (never executed)" in the plan for the
> irrelevant partitions:
>
> https://explain.depesz.com/s/AqlE
>
> However once I run "analyze foo_bar_baz" (or "vacuum a
Tom Lane schrieb am 03.08.2019 um 18:05:
> Yeah, I get the same plan with or without ANALYZE, too. In this example,
> having the ANALYZE stats barely moves the rowcount estimates for
> foo_bar_baz at all, so it's not surprising that the plan doesn't change.
> (I do wonder how Thomas got a differen
I too got the same plan (non runtime partition pruning plan) with or
without the statistics. So it looks like the workaround until this is
fixed is to re-arrange the query to do a subselect to force the runtime
partition pruning as Andreas suggested, which I tested and indeed does
work for me
Andreas Kretschmer writes:
> Am 03.08.19 um 16:06 schrieb Thomas Kellerer:
>> But I'm more confused (or concerned) by the fact that the (original)
>> query works correctly *without* statistics.
> can't reproduce that :-( (PG 11.4 Community)
Yeah, I get the same plan with or without ANALYZE, to
Am 03.08.19 um 16:06 schrieb Thomas Kellerer:
it's posible to rewrite the query to:
test=# explain analyse select count(*) from foo_bar_baz as fbb where
foo_id = (select foo_id from foo where foo_name = 'eeny');
I know, that's not a solution, but a workaround. :-(
Yes, I discovered that
it's posible to rewrite the query to:
test=# explain analyse select count(*) from foo_bar_baz as fbb where foo_id =
(select foo_id from foo where foo_name = 'eeny');
I know, that's not a solution, but a workaround. :-(
Yes, I discovered that as well.
But I'm more confused (or concerned) by
Hi,
Am 03.08.19 um 15:16 schrieb MichaelDBA:
I too am a bit perplexed by why runtime partition pruning does not
seem to work with this example. Anybody got any ideas of this?
please don't top-posting.
it's posible to rewrite the query to:
test=# explain analyse select cou
I too am a bit perplexed by why runtime partition pruning does not seem
to work with this example. Anybody got any ideas of this?
Regards,
Michael Vitale
Thomas Kellerer wrote on 8/2/2019 9:58 AM:
I stumbled across this question on SO:
https://stackoverflow.com/questions/56517852
Only Scan (never executed)" in the plan for the
irrelevant partitions:
https://explain.depesz.com/s/AqlE
However once I run "analyze foo_bar_baz" (or "vacuum analyze"), Postgres
chooses to do a "Parallel Seq Scan" for each partition:
https://explain.de
HI ,
Ok thanks.
Regards,
Suganthi Sekar
From: Laurenz Albe
Sent: 14 February 2019 18:07:49
To: suganthi Sekar; pgsql-performance@lists.postgresql.org
Subject: Re: partition pruning
suganthi Sekar wrote:
> i am using Postgresql 11, i have 2 partition ta
On Thu, Feb 14, 2019 at 01:37:49PM +0100, Laurenz Albe wrote:
> There is no condition on the table "call_report2" in your query,
> so it is not surprising that all partitions are scanned, right?
Some people find it surprising, since: a.call_id=b.call_id
suganthi Sekar wrote:
> > explain analyze
>
suganthi Sekar wrote:
> i am using Postgresql 11, i have 2 partition table , when i joined both
> table in query
> a table its goes exact partition table , but other table scan all partition
>
> please clarify on this .
>
> i have enabled below parameter on in configuration file
> Note : a
35 matches
Mail list logo