> -----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 to prefer Hash Join > > 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?
Try making small adjustments to either random_page_cost or cpu_tuple_cost. They can influence the planners choice here. I have solved similar issues in the past by adjusting one or the other. Be aware thought that those changes can have negative effects in other places, so be sure to test. Brad. -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance