Re: Postgresql 13 query engine regression

2021-05-10 Thread Jonathan Chen
On Tue, 11 May 2021 at 12:49, David Rowley wrote: > > On Tue, 11 May 2021 at 11:34, Jonathan Chen wrote: > > PG13 LIMIT 1 : https://explain.depesz.com/s/GFki > > PG13 no LIMIT: https://explain.depesz.com/s/U4vR > > PG12 LIMIT 1 : https://explain.depesz.com/s/JAp4 > > The difference is coming from

Re: Postgresql 13 query engine regression

2021-05-10 Thread David Rowley
On Tue, 11 May 2021 at 11:34, Jonathan Chen wrote: > PG13 LIMIT 1 : https://explain.depesz.com/s/GFki > PG13 no LIMIT: https://explain.depesz.com/s/U4vR > PG12 LIMIT 1 : https://explain.depesz.com/s/JAp4 The difference is coming from the fact that PostgreSQL 13 has incremental sort and can use th

Re: Postgresql 13 query engine regression

2021-05-10 Thread Jonathan Chen
Hmm, there's a bit of text-mangling. Let's use https://explain.depesz.com. PG13 LIMIT 1 : https://explain.depesz.com/s/GFki PG13 no LIMIT: https://explain.depesz.com/s/U4vR PG12 LIMIT 1 : https://explain.depesz.com/s/JAp4 -- Jonathan Chen

Re: Postgresql 13 query engine regression

2021-05-10 Thread Jonathan Chen
Hi, Here's a bit more detail: select version(); version - PostgreSQL 13.2 on amd64-portbld-freebsd12.2, compiled by FreeBSD

Re: Postgresql 13 query engine regression

2021-05-10 Thread Jonathan Chen
Hi, On Tue, 11 May 2021 at 10:34, Tom Lane wrote: [...] > As Adrian noted, you haven't provided enough detail to let anyone > offer more than generalities. I'll be providing the output of EXPLAIN (ANALYZE, BUFFERS) in a separate post. > However, in the spirit of generalities ... [.. helpful exp

Re: Postgresql 13 query engine regression

2021-05-10 Thread Tom Lane
Jonathan Chen writes: > I am running Postgresql 13 as a backend for Odoo, and I believe I have > discovered a regression with the query engine. As Adrian noted, you haven't provided enough detail to let anyone offer more than generalities. However, in the spirit of generalities ... ORDER BY wit

Re: Postgresql 13 query engine regression

2021-05-10 Thread Marc Millas
Hi, sorry to jump in, but looks like I have a similar pb on a 12.6 instance. on a quite simple request, with limit 1000 it takes 27ms, and with limit 10, it takes 145000 ms looking at both the explain analyze plans, there is a huge difference: with limit 1000, postgres do an optimization of the pl

Re: Postgresql 13 query engine regression

2021-05-10 Thread Adrian Klaver
On 5/10/21 2:13 PM, Jonathan Chen wrote: Hi, I am running Postgresql 13 as a backend for Odoo, and I believe I have discovered a regression with the query engine. See here: https://wiki.postgresql.org/wiki/Slow_Query_Questions for the information needed to get an answer to this sort of quest

Postgresql 13 query engine regression

2021-05-10 Thread Jonathan Chen
Hi, I am running Postgresql 13 as a backend for Odoo, and I believe I have discovered a regression with the query engine. This (simplified) query generated by the ORM takes 47.683s to complete (the result set is empty): SELECT "account_bank_statement_line".id FROM "account_bank_statement_line" LE

Re: trigger impacting insertion of records

2021-05-10 Thread Michael Lewis
It seems like there is some flaw here. From my reading, on insert of any row, you are updating ALL rows in the same table to just remove an underscore if it matches the pattern of 'US_' at the beginning. That doesn't seem likely to be what you want. I'd think you would want something like the below

Re: Copyright vs Licence

2021-05-10 Thread Michael Nolan
> What can and does happen is that a new version is released under a different license while the old version is made obsolete. It is often more than just 'made obsolete', updates to other parts of the OS (that are almost impossible to avoid installing) can make it so those older products either d

Re: force partition pruning

2021-05-10 Thread Vijaykumar Jain
I do not know how to put this in words, but see below when the predicate is explicitly applied to the main table with partition. postgres=# \d+ prt1 Partitioned table "public.prt1" Column | Type| Collation | Nullable | Default | Storage | Stats ta

Re: Copyright vs Licence

2021-05-10 Thread cen
If MSFT is the sole holder of the copyright, then they can relicense it as they see fit. *I think* that they can only change the license on *newer* versions, so you'd be able to keep using the latest OSS version. That is correct. If I get a version 1 of your program under license A you can't

force partition pruning

2021-05-10 Thread Niels Jespersen
Hi all I need a litte advice on how to Postgres 13.2 A metadata query pulls partition keys: select m.period_version from register.register_metadata m where m.current_version and m.period between '201712' and '201912' ; A query using these in an in-list easily makes the planner do partition pr

Re: Copyright vs Licence

2021-05-10 Thread Ron
On 5/10/21 4:34 AM, Vijaykumar Jain wrote: Hi All, I have been playing around with the pg_auto_failover extension by citus and have really enjoyed playing chaos with it. citusdata/pg_auto_failover: Postgres extension and service for automated failover and high-availability (github.com)

Copyright vs Licence

2021-05-10 Thread Vijaykumar Jain
Hi All, I have been playing around with the pg_auto_failover extension by citus and have really enjoyed playing chaos with it. citusdata/pg_auto_failover: Postgres extension and service for automated failover and high-availability (github.com) Now I