pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Benjamin Arai <benjamin@araisoft.com>
To: pgsql-general@postgresql.org
To: pgsql-admin@postgresql.org
Subject: OUTER JOIN IS SLOW
Date: Sat, 23 Dec 2006 12:11:02 -0800
Message-ID: <458D8D56.6020506@araisoft.com> (raw)

I have been running pieces of my PL function by hand and I have found 
that the following queries work by themselves taking less than a second 
to execute.

getDateRange"('12/1/2005','12/1/2006')  <- simply generates a date 
list.  Doesn't even access a table

SELECT * FROM mutualfd_weekday_qbid WHERE cusip='92193920' AND  pkey >= 
'12/15/2005' AND pkey <= '12/15/2006';

But when combined as below it takes 10 seconds to execute.

SELECT d1 as date, d2.data as data FROM 
"getDateRange"('12/1/2005','12/1/2006') d1 FULL OUTER JOIN (SELECT * 
FROM mutualfd_weekday_qbid WHERE cusip='92193920' AND  pkey >= 
'12/15/2005' AND pkey <= '12/15/2006') d2 ON d1=d2.pkey;

Do I need to increase the work_mem or is this possible still a ANALYZE 
issue?

Benjamin



view thread (9+ messages)  latest in thread

Message-ID: <458D8D56.6020506@araisoft.com>
Permalink:  ../458D8D56.6020506@araisoft.com/
Also on:    postgresql.org/message-id/458D8D56.6020506@araisoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: benjamin@araisoft.com, pgsql-general@postgresql.org
  Subject: Re: OUTER JOIN IS SLOW
  In-Reply-To: <458D8D56.6020506@araisoft.com>
  References: <458D8D56.6020506@araisoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox