Re: Query performance issue

2024-10-22 Thread yudhi s
On Wed, Oct 23, 2024 at 2:06 AM yudhi s wrote: > > > On Wed, Oct 23, 2024 at 12:32 AM Greg Sabino Mullane > wrote: > >> To be frank, there is so much wrong with this query that it is hard to >> know where to start. But a few top items: >> >> * Make sure all of the tables involved have been analy

Re: Query performance issue

2024-10-22 Thread Laurenz Albe
On Tue, 2024-10-22 at 13:06 -0700, David G. Johnston wrote: > On Tue, Oct 22, 2024 at 1:01 PM Ron Johnson wrote: > > On Tue, Oct 22, 2024 at 3:02 PM Greg Sabino Mullane > > wrote: > > > * Don't use the "FROM table1, table2, table3" syntax but use "FROM table1 > > > JOIN table2 ON (...) JOIN tab

Re: Query performance issue

2024-10-22 Thread yudhi s
On Wed, Oct 23, 2024 at 12:32 AM Greg Sabino Mullane wrote: > To be frank, there is so much wrong with this query that it is hard to > know where to start. But a few top items: > > * Make sure all of the tables involved have been analyzed. You might want > to bump default_statistics_target up and

Re: Query performance issue

2024-10-22 Thread David G. Johnston
On Tue, Oct 22, 2024 at 1:01 PM Ron Johnson wrote: > On Tue, Oct 22, 2024 at 3:02 PM Greg Sabino Mullane > wrote: > [snip] > >> * Don't use the "FROM table1, table2, table3" syntax but use "FROM table1 >> JOIN table2 ON (...) JOIN table3 ON (...) >> > > Why? > > Readability is improved when done

Re: Query performance issue

2024-10-22 Thread Ron Johnson
On Tue, Oct 22, 2024 at 3:02 PM Greg Sabino Mullane wrote: [snip] > * Don't use the "FROM table1, table2, table3" syntax but use "FROM table1 > JOIN table2 ON (...) JOIN table3 ON (...) > Why? -- Death to , and butter sauce. Don't boil me, I'm still alive. crustacean!

Re: Basebackup fails without useful error message

2024-10-22 Thread Koen De Groote
Hello David, I saw the backup fail. The backup logged that it terminated the walsender, and correlating the moment it failed to the metrics of my storage, shows the storage at that time was facing a huge IOWAIT. And this was a network mounted storage. The backup process continued, but because of

Re: Query performance issue

2024-10-22 Thread Greg Sabino Mullane
To be frank, there is so much wrong with this query that it is hard to know where to start. But a few top items: * Make sure all of the tables involved have been analyzed. You might want to bump default_statistics_target up and see if that helps. * As mentioned already, increase work_mem, as you

Lock contention issues with repack

2024-10-22 Thread Durgamahesh Manne
Hi DEBUG: Poll returned: 1 LOG: Command finished in worker 1: CREATE UNIQUE INDEX index_3199790649 ON repack.table_5832724 USING btree (id) DEBUG: swap DEBUG: query failed: ERROR: canceling statement due to statement timeout DETAIL: query was: LOCK TABLE offer.market IN ACCESS EXCLUSIVE

Re: Regression in Postgres 17?

2024-10-22 Thread Dominique Devienne
On Tue, Oct 22, 2024 at 6:03 PM Achilleas Mantzios wrote: > Στις 22/10/24 18:54, ο/η Colin 't Hart έγραψε: > This works in Postgres 15: > Do this instead : > create function json_test(out value text, out jsonparam jsonb) ... > apparently json is a reserved word (now) and won't be accepted as funct

Re: Regression in Postgres 17?

2024-10-22 Thread Tom Lane
Adrian Klaver writes: >> In Postgres 17 trying to create the function yields an error: >> >> pg17> create function json_test(out value text, out json jsonb) >> returns record >> ... >> ERROR:  syntax error at or near "jsonb" >> LINE 1: create function json_test(out value text, out json jsonb) >>

Re: Regression in Postgres 17?

2024-10-22 Thread Adrian Klaver
On 10/22/24 08:54, Colin 't Hart wrote: Hi, This works in Postgres 15: pg15> create function json_test(out value text, out json jsonb) returns record language sql as $$   select null::text, null::jsonb; $$ ; CREATE FUNCTION pg15> select * from json_test(); ┌───┬──┐ │ value │ json │ ├──

Re: Regression in Postgres 17?

2024-10-22 Thread Achilleas Mantzios
Στις 22/10/24 18:54, ο/η Colin 't Hart έγραψε: Hi, This works in Postgres 15: pg15> create function json_test(out value text, out json jsonb) returns record language sql as $$   select null::text, null::jsonb; $$ ; CREATE FUNCTION pg15> select * from json_test(); ┌───┬──┐ │ value │ jso

Re: Query performance issue

2024-10-22 Thread Jeff Ross
On 10/21/24 23:31, yudhi s wrote: On Thu, Oct 17, 2024 at 3:06 AM Peter J. Holzer wrote: The execution plan looks like a postgresql execution plan, not a mysql execution plan. Did you run this query on postgresql? That may be interesting for comparison purposese, but ultimately i

Regression in Postgres 17?

2024-10-22 Thread Colin 't Hart
Hi, This works in Postgres 15: pg15> create function json_test(out value text, out json jsonb) returns record language sql as $$ select null::text, null::jsonb; $$ ; CREATE FUNCTION pg15> select * from json_test(); ┌───┬──┐ │ value │ json │ ├───┼──┤ │ │ │ └───┴───