On Wednesday 02 April 2003 16:00, Johnson, Shaunn wrote:
> Running PostgreSQL 7.2.1 on RedHat Linux 7.2.
>
> Question - I'm looking at one of the users query
>
> [snip query]
> 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%'
> --ORDER BY
> -- db2_gm_reg_prof_01.contract_num ASC;
>
> [/snip query]
From this query, db2_pos_reg_prof_01 does not seem to be joined
explicity to db2_gm_reg_prof_01. This may be producing more rows than
you want (cartesian join)...
Ian Barwick
barwick@gmx.net