Errors "failed to construct the join relation" and "failed to buildany 2-way joins"

Поиск
Список
Период
Сортировка
От Will Leinweber
Тема Errors "failed to construct the join relation" and "failed to buildany 2-way joins"
Дата
Msg-id CALLb-4xJMd4GZt2YCecMC95H-PafuWNKcmps4HLRx2NHNBfB4g@mail.gmail.com
обсуждение исходный текст
Ответы Re: Errors "failed to construct the join relation" and "failed to build any 2-way joins"  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 12.1, fresh initdb the following query gives me the error
"ERROR:  failed to construct the join relation"

  SELECT FROM (
    SELECT FROM pg_catalog.pg_stat_bgwriter AS ref_0
    LEFT JOIN pg_catalog.pg_stat_bgwriter AS ref_1 ON (true), LATERAL (
      SELECT FROM pg_catalog.pg_publication AS ref_2, LATERAL (
        SELECT FROM pg_catalog.pg_class
        WHERE ref_1.buffers_alloc IS NOT NULL
      ) AS subq_0
      WHERE true
      LIMIT 1
    ) AS subq_1
    WHERE true
  ) AS subq_2

If you move the limit up into subq_0, then the error changes to
"ERROR:  failed to build any 2-way joins"

  SELECT FROM (
    SELECT FROM pg_catalog.pg_stat_bgwriter AS ref_0
    LEFT JOIN pg_catalog.pg_stat_bgwriter AS ref_1 ON (true), LATERAL (
      SELECT FROM pg_catalog.pg_publication AS ref_2, LATERAL (
        SELECT FROM pg_catalog.pg_class
        WHERE ref_1.buffers_alloc IS NOT NULL
        LIMIT 1
      ) AS subq_0
      WHERE true
    ) AS subq_1
    WHERE true
  ) AS subq_2

I'm unable to reproduce either of the errors on 11.6 or 11.4. I haven't tried
any other versions. The actual value of the limit doesn't appear to matter,
just if it's present or not.

— Will



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Corruption with duplicate primary key
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: shared tempfile was not removed on statement_timeout (unreproducible)