Re: Re: Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-11 Thread Pavel Stehule
út 11. 10. 2022 v 10:01 odesílatel gzh napsal: > Thank you for providing the requested information. > > > The WebSite has been used for many years, and this upgrade is only a > version upgrade of the PostgreSQL database. > My customer does not want to modify the SQL because it will increase the >

Re:Re: Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-11 Thread gzh
Thank you for providing the requested information. The WebSite has been used for many years, and this upgrade is only a version upgrade of the PostgreSQL database. My customer does not want to modify the SQL because it will increase the cost of the project(All SQL that contains a LIMIT claus

Re: Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-10 Thread Pavel Stehule
út 11. 10. 2022 v 7:08 odesílatel gzh napsal: > Hi, Pavel > > > > The LIMIT clause changes total cost. This is a very aggressive clause. > And > > > although it is absolutely useless in this case, Postgres does not have > any > > > logic for removing it. Postgres doesn't try to fix developer's m

Re: Re: Re: Different execution plan between PostgreSQL 8.4 and 12.11

2022-10-10 Thread Pavel Stehule
út 11. 10. 2022 v 6:05 odesílatel gzh napsal: > > Hi, Pavel > > Thank you for your reply. > > > > the LIMIT clause is in this case totally useless and messy, and maybe can > > > negative impacts optimizer > > Yes. After removing the LIMIT clause, the performance is improved. > > The execution pla