JUST NOT ADDING UP

Поиск
Список
Период
Сортировка
От Rhys Stewart
Тема JUST NOT ADDING UP
Дата
Msg-id 189966030606230643n2d85128foc8f53cc895f13fa8@mail.gmail.com
обсуждение исходный текст
Ответы Re: JUST NOT ADDING UP  (Alban Hertroys <alban@magproductions.nl>)
Список pgsql-general
 hi all,
something is not adding up. the following query is taking a long time
to run.(its still running right now)

select distinct on (prem) prem, num, addy, mynum,myad,ff.address, matchtype,
the_geom
from daily.recheck2, _sp_myparcels ff
where
prem not in (
select  distinct on (prem) prem from daily.recheck2 dr, _sp_myparcels ff
where ff.address = unabrev
)
AND btrim(addy) = btrim(myad)
AND  num = mynum

UNION

select  distinct on (prem) prem, num, addy, mynum,myad,dr.unabrev,
matchtype,  ff.the_geom
from daily.recheck2 dr, _sp_myparcels ff--, feeder_polygon
where ff.address = unabrev

the thing is if i run the first query by itself, it takes like about 2
seconds, and if i run the subquery that takes about 2 seconds also, so
why (well its now finished, took all of 3.31 minutes) does it take so
long?

В списке pgsql-general по дате отправления:

Предыдущее
От: Kenneth Downs
Дата:
Сообщение: Re: minimizing downtime when upgrading
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Plperl and my() lexical variables bug?