On Fri, 2022-03-25 at 14:07 +0000, Kumar, Mukesh wrote: > > [recommendation to fix the estimate] > > > > Perhaps it is also enough to blindly disable nested loop joins for the whole query, > > rather than doing the right thing and fixing the estimates: > > > > BEGIN; > > SET LOCAL enable_nestloop = off; > > SELECT ...; > > COMMIT; > > Thanks for the below suggestion , When I ran the query with the parameter , it is taking only 1 sec. > > So could you please let me know if I can put this parameter to OFF . at database and it will not > create any issues to queries running in database. That will very likely cause problems in your database, because sometimes a nested loop join is by far the most efficient way to run a query. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com