Representation of SubPlan testexpr in EXPLAIN

Поиск
Список
Период
Сортировка
От Andrey Lepikhov
Тема Representation of SubPlan testexpr in EXPLAIN
Дата
Msg-id de9a504e-0470-843d-72d6-3abc7517a448@postgrespro.ru
обсуждение исходный текст
Список pgsql-hackers
Hi,

EXPLAIN command doesn't show testexpr. Sometimes it is not easy to 
understand a query plan. That I mean:

CREATE TABLE a (x integer, y integer);
EXPLAIN (COSTS OFF, VERBOSE) SELECT x, y FROM a upper
   WHERE y IN (SELECT y FROM a WHERE upper.y = x);
EXPLAIN (COSTS OFF, VERBOSE) SELECT x, y FROM a upper
   WHERE x+y IN (SELECT y FROM a WHERE upper.y = x);

These two explains have the same representation:
Seq Scan on public.a upper
    Output: upper.x, upper.y
    Filter: (SubPlan 1)
    SubPlan 1
      ->  Seq Scan on public.a
            Output: a.y
            Filter: (upper.y = a.x)

It is a bit annoying when you don't have original query or don't trust 
competence of a user who sent you this explain.
In attachment - patch which solves this problem. I'm not completely sure 
that this option really needed and patch presents a proof of concept only.

-- 
regards,
Andrey Lepikhov
Postgres Professional

Вложения

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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Separate out FileSet from SharedFileSet (was Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o)
Следующее
От: "蔡梦娟(玊于)"
Дата:
Сообщение: 回复:Queries that should be canceled will get stuck on secure_write function