Re: - Slow Query

From: Віталій Тимчишин <tivv00(at)gmail(dot)com>
To: Mike Ivanov <mikei(at)activestate(dot)com>
Cc: Rui Carvalho <rui(dot)hmcarvalho(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: - Slow Query
Date: 2009-07-03 11:29:28
Message-ID: 331e40660907030429q206701bfg32e7f6a6bd5c7963@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Sorry, it was an error in previous letter.

3 липня 2009 р. 14:22 Віталій Тимчишин <tivv00(at)gmail(dot)com> написав:

>
>
> 2009/7/1 Mike Ivanov <mikei(at)activestate(dot)com>
>
>>
>>
>> > LEFT outer JOIN ville ON ville.uid = bien.ref_ville
>> > LEFT outer JOIN freguesia_ville ON freguesia_ville.ref_ville =ville.uid
>>
>> This is not enough. You have to add this condition as well:
>>
>> AND bien.ref_ville = freguesia_ville.ref_ville
>>
>> In other words, when you link three tables by a common field, all three
>> relationships should be explicitly expressed, otherwise you'll have this
>> type of explosive row multiplication.
>>
>
> Why so? Is not changing "freguesia_ville.ref_ville =ville.uid" to
> "freguesia_ville.ref_ville =bien.ref_ville" enough (to prevent cases when
> ville.uid is null as result of join)?
>
>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Patvs 2009-07-04 18:51:48 Six PostgreSQL questions from a pokerplayer
Previous Message Віталій Тимчишин 2009-07-03 11:22:35 Re: - Slow Query