Re: Query optimization advice for beginners

2020-01-28 Thread Laurenz Albe
On Mon, 2020-01-27 at 13:15 +, Kemal Ortanca wrote: > There is a query that runs slowly when I look at the logs of the database. > When I check the > resources of the system, there is no problem in the resources, but this query > running slowly. > There is no "Seq Scan" in the queries, so the

Re: Query optimization advice for beginners

2020-01-27 Thread Michael Lewis
You've got two references to order_basketitemdetail both aliased to bid and ALSO a table called order_basketitembatch aliased to bib. I assume that confuses the planner, but even if it doesn't it certainly confuses any new developers trying to understand the query's intention. The biggest thing th

Re: Query optimization advice for beginners

2020-01-27 Thread Kemal Ortanca
Subject: Re: Query optimization advice for beginners Am 27.01.20 um 14:15 schrieb Kemal Ortanca: > > https://explain.depesz.com/s/G4vq > > the estimates and the real values are very different, seems like problems with autoanalyze. which version? Andreas -- 2ndQuadrant - The Postgr

Re: Query optimization advice for beginners

2020-01-27 Thread Andreas Kretschmer
Am 27.01.20 um 14:15 schrieb Kemal Ortanca: https://explain.depesz.com/s/G4vq the estimates and the real values are very different, seems like problems with autoanalyze. which version? Andreas -- 2ndQuadrant - The PostgreSQL Support Company. www.2ndQuadrant.com

Query optimization advice for beginners

2020-01-27 Thread Kemal Ortanca
Hello mail group members, I started a new job as PostgreSQL DBA. This is my first mail, I hope the mail I sent meets the rules. There is a query that runs slowly when I look at the logs of the database. When I check the resources of the system, there is no problem in the resources, but this qu