Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-12 Thread atxcanadian
Sorry about that, excel clipped off the dates. -- View this message in context: http://postgresql.nabble.com/How-to-get-explain-plan-to-prefer-Hash-Join-tp5841450p5841633.html Sent from the PostgreSQL - performance mailing li

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-12 Thread Jeff Janes
On Thu, Mar 12, 2015 at 8:59 AM, atxcanadian wrote: > Here is the output: > > > > This is after I've manually ran analyze. > The "last_*" columns are only showing times, and not full timestamps. Does your reporting tool drop th

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-12 Thread atxcanadian
Here is the output: This is after I've manually ran analyze. -- View this message in context: http://postgresql.nabble.com/How-to-get-explain-plan-to-prefer-Hash-Join-tp5841450p5841610.html Sent from the PostgreSQL - perform

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-12 Thread Jeff Janes
On Wed, Mar 11, 2015 at 5:35 PM, atxcanadian wrote: > > I'm a little perplexed why the autovacuum wasn't keeping up. Any > recommendations for those settings to push it to do a bit more analyzing of > the tables?? > What does pg_stat_user_tables show for that table?

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-12 Thread atxcanadian
Isn't a random_page_cost of 1 a little aggressive? We are currently setup on Amazon SSD with software RAID 5. -- View this message in context: http://postgresql.nabble.com/How-to-get-explain-plan-to-prefer-Hash-Join-tp5841450p5841605.html Sent from the PostgreSQL - performance mailing list ar

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-11 Thread Pavel Stehule
2015-03-12 1:35 GMT+01:00 atxcanadian : > So I implemented two changes. > > - Moved random_page_cost from 1.1 to 2.0 > random_page_cost 1 can enforce nested_loop - it is very cheap with it > - Manually ran analyze on all the tables > > *Here is the new explain analyze:* > QUERY PLAN > HashAggre

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-11 Thread atxcanadian
So I implemented two changes. - Moved random_page_cost from 1.1 to 2.0 - Manually ran analyze on all the tables *Here is the new explain analyze:* QUERY PLAN HashAggregate (cost=74122.97..74125.53 rows=256 width=24) (actual time=45.205..45.211 rows=24 loops=1) InitPlan 1 (returns $0) ->

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-11 Thread Jeff Janes
On Wed, Mar 11, 2015 at 10:01 AM, atxcanadian wrote: > Currently seeing massive increase in performance when optimizer chooses > Hash > Join over Nested Loops. I achieve this by temporarily setting nested loops > off. I'd like to setup some database variables where the optimizer prefers > hash jo

Re: [PERFORM] How to get explain plan to prefer Hash Join

2015-03-11 Thread Nicholson, Brad (Toronto, ON, CA)
> -Original Message- > From: pgsql-performance-ow...@postgresql.org [mailto:pgsql-performance- > ow...@postgresql.org] On Behalf Of atxcanadian > Sent: Wednesday, March 11, 2015 1:01 PM > To: pgsql-performance@postgresql.org > Subject: [PERFORM] How to get explain plan t

[PERFORM] How to get explain plan to prefer Hash Join

2015-03-11 Thread atxcanadian
Currently seeing massive increase in performance when optimizer chooses Hash Join over Nested Loops. I achieve this by temporarily setting nested loops off. I'd like to setup some database variables where the optimizer prefers hash joins. Any suggestions? *Query in question:* explain analyze selec