Re: inputs into query planner costing - Mailing list pgsql-general

From Mike Roest
Subject Re: inputs into query planner costing
Date
Msg-id CAE7Byhiyj7j=rQgYxGaVqtRemraOVMsPCU7-t0oX4uxEB=PjwA@mail.gmail.com
Whole thread Raw
In response to Re: inputs into query planner costing  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Thanks for the responses 

For anyone searching in the future I'll answer Tom's questions and list the boneheaded fix that it ended up actually being (really painful as I've been fighting this for a week).

1) According to amazon they run stock postgres as far as the query planner is concerned.
2) Yes sorry I forgot to note on our prod system the random_page_cost was 2 vs 4 on the RDS system.
3) I had run vacuum on all the tables in the query and the pg_relation_size on the tables aren't way out of wack
4) Yep both default_statistics_target was the default of 100 on both.

I was concentrating completely on the wrong direction here.  What it turned out to be was the RDS configuration of postgres which we had modified somewhat I had missed configuring work_mem to something greater then their default of 1 MB.  Once I brought work_mem upto the same value as our production server low and behold the query runs fast.

Sorry for wasting everyones time.  Hopefully this will help someone else down the line.

pgsql-general by date:

Previous
From: zach cruise
Date:
Subject: Re: how would you speed up this long query?
Next
From: Fabio Ugo Venchiarutti
Date:
Subject: Re: Partial index-based load balancing