Re: [HACKERS] Problem with complex query

Поиск
Список
Период
Сортировка
От Oleg Broytmann
Тема Re: [HACKERS] Problem with complex query
Дата
Msg-id Pine.SOL2.3.96.SK.990224183415.10537L-100000@sun.med.ru
обсуждение исходный текст
Ответ на Re: [HACKERS] Problem with complex query  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi!

On Wed, 24 Feb 1999, Tom Lane wrote:
> What version are you running?  Also, does it act the same if you try to
  6.4.2 on Sparc-solaris2.5.1

> EXPLAIN that same query?  If EXPLAIN fails then the problem is in the
> plan/optimize stage, not actual execution of the query.
  EXPLAIN works fine:

EXPLAIN SELECT DISTINCT p.subsec_id  FROM central cn, shops sh, districts d, positions p     WHERE cn.shop_id =
sh.shop_idAND sh.distr_id = d.distr_id     AND   d.city_id = 2 AND cn.pos_id = p.pos_id     AND   cn.date_i >=
current_date- '7 days'::timespan
 
;
NOTICE:  QUERY PLAN:

Unique  (cost=0.00 size=0 width=0) ->  Sort  (cost=0.00 size=0 width=0)       ->  Nested Loop  (cost=0.00 size=1
width=16)            ->  Nested Loop  (cost=0.00 size=1 width=12)                   ->  Merge Join  (cost=0.00 size=1
width=8)                        ->  Seq Scan  (cost=0.00 size=0 width=0)                               ->  Sort
(cost=0.00size=0 width=0)                                     ->  Seq Scan on districts d
 
(cost=0.00 size=0 width=2)                         ->  Seq Scan  (cost=0.00 size=0 width=0)
 ->  Sort  (cost=0.00 size=0 width=0)                                     ->  Seq Scan on shops sh  (cost=0.00
 
size=0 width=6)                   ->  Seq Scan on central cn  (cost=0.00 size=0 width=4)             ->  Seq Scan on
positionsp  (cost=0.00 size=0 width=4)
 

EXPLAIN

Oleg.
----    Oleg Broytmann     http://members.xoom.com/phd2/     phd2@earthling.net          Programmers don't die, they
justGOSUB without RETURN.
 



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] postmaster failure with 2-23 snapshot
Следующее
От: Oleg Broytmann
Дата:
Сообщение: Re: [HACKERS] VACUUM ANALYZE problem on linux