[GENERAL] emitting all plans considered for a query (as opposed to just thewinning one) - Mailing list pgsql-general

From Dan Hitt
Subject [GENERAL] emitting all plans considered for a query (as opposed to just thewinning one)
Date
Msg-id CAOphizKXjvb+oQ2YdyDA2sLE1m5VjAzREkawbJ2hv6atvgPxXQ@mail.gmail.com
Whole thread Raw
List pgsql-general
Suppose that i have a select query that involves a small number of
joins, say 3 or 4 and a few where conditions.

I want to list all the query plans that the postgres planner
considers.  I understand that for a small number of joins, the planner
actually considers all possible execution plans.

I haven't been able to find any command on the net that would just
dump all the plans out so that i could see what is possible in
principle (before taking into account the size of the tables or the
distribution of values within them).

And yet, such a list must exist, at least internally, and further,
when the planner is debugged or subjected to regression testing, there
must be a way to see what plans it is considering ---- although
conceivably it could all just be using gdb to step through internal
structures.

Anyhow, would appreciate this very much, and thanks in advance for any
info about how to do this, or where to search.  (Maybe i'm just
looking in all the wrong places.)

dan


pgsql-general by date:

Previous
From: Jong-won Choi
Date:
Subject: Re: [GENERAL] array_to_json - dealing with returning no rows
Next
From: Michael Paquier
Date:
Subject: Re: [GENERAL] Understanding pg_last_xlog_receive_location