Re: the results from a query - question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com>
Cc: "pgsql (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: the results from a query - question
Date: 2003-04-02 14:41:41
Message-ID: 20843.1049294501@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Johnson, Shaunn" <SJohnson6(at)bcbsm(dot)com> writes:
> explain
> select *
> -- INTO dev_gm_er_prof01
> FROM
> db2_gm_reg_prof_01
> WHERE
> db2_gm_reg_prof_01.place_of_service = 2 and
> db2_gm_reg_prof_01.diagnosis_cd not like '29%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '30%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '310%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '311%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '312%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '313%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '314%' and
> db2_gm_reg_prof_01.diagnosis_cd not like '315%' and
> db2_pos_reg_prof_01.diagnosis_cd not like '316%'
^^^

Isn't that a typo?

> Is this *really* supposed to bring back 4587594094 rows into this
> table they are trying to create?

If the two tables indeed have ~2K and ~2M rows respectively, then yes,
an unconstrained join of the two will yield ~4G rows ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-02 14:52:19 Re: Forcing use of indexes
Previous Message Ian Barwick 2003-04-02 14:28:23 Re: the results from a query - question