Re: Query performance issue - Mailing list pgsql-performance

From Michael Lewis
Subject Re: Query performance issue
Date
Msg-id CAHOFxGqM3Gzmp0Ho0oftpBY99aq0+B+gZT+emy6scLRc5LZc3g@mail.gmail.com
Whole thread Raw
In response to Query performance issue  (Nagaraj Raj <nagaraj.sf@yahoo.com>)
List pgsql-performance
What indexes exist on those tables? How many rows do you expect to get back in total? Is the last_contacted_anychannel_dttm clause restrictive, or does that include most of the prospect table (check pg_stats for the histogram if you don't know).

and (a."shared_paddr_with_customer_ind" = 'N') 
               and (a."profane_wrd_ind" = 'N') 
               and (a."tmo_ofnsv_name_ind" = 'N')
                   and (a."has_individual_address" = 'Y') 
               and (a."has_last_name" = 'Y') 
       and (a."has_first_name" = 'Y'))

Are these conditions expected to throw out very few rows, or most of the table?

If you change both joins to EXISTS clauses, do you get the same plan when you run explain?

pgsql-performance by date:

Previous
From: Dane Foster
Date:
Subject: Re: Slow query and wrong row estimates for CTE
Next
From: Dane Foster
Date:
Subject: Re: Slow query and wrong row estimates for CTE