Re: Postgresql planning time too high

2019-11-22 Thread Tomas Vondra
On Fri, Nov 22, 2019 at 11:44:51AM +, Sterpu Victor wrote: No rows should be returned, DB is empty. I'm testing now on a empty DB trying to find out how to improve this. I'm a bit puzzled why you're doinf tests on an empty database, when in production it'll certainly contain data. I guess

Re: Re[4]: Postgresql planning time too high

2019-11-22 Thread Michael Lewis
As a matter of habit, I put all inner joins that may limit the result set as the first joins, then the left joins that have where conditions on them. I am not sure whether the optimizer sees that only those tables are needed to determine which rows will be in the end result and automatically priori

Re: Re[4]: Postgresql planning time too high

2019-11-22 Thread Pavel Stehule
t; -- Original Message -- > From: "Pavel Stehule" > To: "Sterpu Victor" > Cc: "Fırat Güleç" ; "Pgsql Performance" < > pgsql-performance@lists.postgresql.org> > Sent: 2019-11-22 2:59:11 PM > Subject: Re: Re[2]: Postgresql plann

Re[4]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
, can I do something else to fix this? Thank you. -- Original Message -- From: "Pavel Stehule" To: "Sterpu Victor" Cc: "Fırat Güleç" ; "Pgsql Performance" Sent: 2019-11-22 2:59:11 PM Subject: Re: Re[2]: Postgresql planning time too high

Re[4]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
vel Stehule" To: "Sterpu Victor" Cc: "Fırat Güleç" ; "Pgsql Performance" Sent: 2019-11-22 2:59:11 PM Subject: Re: Re[2]: Postgresql planning time too high pá 22. 11. 2019 v 12:46 odesílatel Sterpu Victor napsal: No rows should be returned, DB is empty. I'm

Re: Re[2]: Postgresql planning time too high

2019-11-22 Thread Pavel Stehule
Sinan Cd. No:3 Güzeller Org.San.Bölg. GEBZE / KOCAELİ > > [image: image.png] > > > > > > > > *From:* Sterpu Victor > *Sent:* Friday, November 22, 2019 2:21 PM > *To:* pgsql-performance@lists.postgresql.org > *Subject:* Postgresql planning time too high > >

RE: Re[2]: Postgresql planning time too high

2019-11-22 Thread Fırat Güleç
Could you run VACCUM ANALYZE. *From:* Sterpu Victor *Sent:* Friday, November 22, 2019 2:46 PM *To:* Fırat Güleç *Cc:* pgsql-performance@lists.postgresql.org *Subject:* Re[2]: Postgresql planning time too high I did runned "VACCUM FULL" followed by "VACUUM&quo

RE: Postgresql planning time too high

2019-11-22 Thread Fırat Güleç
.com *M:* 0 532 210 57 18 İnönü Mh. Mimar Sinan Cd. No:3 Güzeller Org.San.Bölg. GEBZE / KOCAELİ [image: image.png] *From:* Sterpu Victor *Sent:* Friday, November 22, 2019 2:21 PM *To:* pgsql-performance@lists.postgresql.org *Subject:* Postgresql planning time too high Hello I&#x

Re[3]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
focg). -- Original Message -- From: "Sterpu Victor" To: "Fırat Güleç" Cc: pgsql-performance@lists.postgresql.org Sent: 2019-11-22 1:44:51 PM Subject: Re[2]: Postgresql planning time too high No rows should be returned, DB is empty. I'm testing now on a empty DB try

Re[4]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
Victor" Cc: pgsql-performance@lists.postgresql.org Sent: 2019-11-22 2:05:44 PM Subject: RE: Re[2]: Postgresql planning time too high Could you run VACCUM ANALYZE. From: Sterpu Victor Sent: Friday, November 22, 2019 2:46 PM To: Fırat Güleç Cc:pgsql-performance@lists.postgresql.org Subject: Re[2]

Re[4]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
-11-22 2:05:44 PM Subject: RE: Re[2]: Postgresql planning time too high Could you run VACCUM ANALYZE. From: Sterpu Victor Sent: Friday, November 22, 2019 2:46 PM To: Fırat Güleç Cc:pgsql-performance@lists.postgresql.org Subject: Re[2]: Postgresql planning time too high I did runned "

Re: Postgresql planning time too high

2019-11-22 Thread Luís Roberto Weck
o.ro>> Cc: pgsql-performance@lists.postgresql.org <mailto:pgsql-performance@lists.postgresql.org> Sent: 2019-11-22 1:35:15 PM Subject: RE: Postgresql planning time too high Hello Sterpu, First, please run vaccum for your Postgresql DB. No rows returned from your query. Could you double ch

Re[2]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
I did runned "VACCUM FULL" followed by "VACUUM" but no difference. -- Original Message -- From: "Fırat Güleç" To: "Sterpu Victor" Cc: pgsql-performance@lists.postgresql.org Sent: 2019-11-22 1:35:15 PM Subject: RE: Postgresql planning time too h

Re[2]: Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
fine like this. -- Original Message -- From: "Fırat Güleç" To: "Sterpu Victor" Cc: pgsql-performance@lists.postgresql.org Sent: 2019-11-22 1:35:15 PM Subject: RE: Postgresql planning time too high Hello Sterpu, First, please run vaccum for your Postgresql DB. No rows returne

Postgresql planning time too high

2019-11-22 Thread Sterpu Victor
Hello I'm on a PostgreSQL 12.1 and I just restored a database from a backup. When I run a query I get a big execution time: 5.482 ms After running EXPLAIN ANALYZE I can see that the "Planning Time: 5165.742 ms" and the "Execution Time: 6.244 ms". The database is new(no need to vacuum) and i'm th