Re: Query performance issue

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Nagaraj Raj <nagaraj(dot)sf(at)yahoo(dot)com>
Cc: Pgsql Performance <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Query performance issue
Date: 2021-02-16 16:40:08
Message-ID: CAHOFxGqM3Gzmp0Ho0oftpBY99aq0+B+gZT+emy6scLRc5LZc3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dane Foster 2021-02-16 19:11:07 Re: Slow query and wrong row estimates for CTE
Previous Message Dane Foster 2021-02-16 15:25:09 Re: Slow query and wrong row estimates for CTE