Re: [PERFORM] Slow join query

2007-06-22 Thread Scott Marlowe
Tom Tamulewicz wrote: SELECT p.party_id, p.first_name, p.last_name, pli.address1, pli.city, pli.state FROM customer as p JOIN address as pli ON ( p.party_id = pli.party_id ) WHERE ( p.void_flag IS N

Re: [PERFORM] Slow join query

2007-06-22 Thread Tom Tamulewicz
  From: Michael Glaesemann <[EMAIL PROTECTED]>To: Tom Tamulewicz <[EMAIL PROTECTED]>CC: pgsql-performance@postgresql.orgSubject: Re: [PERFORM] Slow join queryDate: Fri, 22 Jun 2007 14:51:32 -0500>>On Jun 22, 2007, at 13:32 , Tom Tamulewicz wrote:>>( p.void_flag IS NULL OR p.void_flag = false

Re: [PERFORM] Slow join query

2007-06-22 Thread Michael Glaesemann
[Please don't top post as it makes the discussion more difficult to follow.] On Jun 22, 2007, at 16:25 , Tom Tamulewicz wrote: The explain is as follows... EXPLAIN ANALYZE, please. (And for convenience, it helps if you include the query :) ) Michael Glaesemann grzm seespotcode net -

Re: [PERFORM] Slow join query

2007-06-22 Thread Tom Tamulewicz
The explain is as follows...    QUERY PLAN   

Re: [PERFORM] Slow join query

2007-06-22 Thread Michael Glaesemann
On Jun 22, 2007, at 13:32 , Tom Tamulewicz wrote: ( p.void_flag IS NULL OR p.void_flag = false ) Just a note: you can rewrite (a IS NULL or a = false) as (a IS NOT TRUE). Shouldn't affect performance, but might make your query easier to read. What's the EXPLAIN ANALYZE output for this quer