Re: EXPLAIN CREATE TABLE AS

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: EXPLAIN CREATE TABLE AS
Дата
Msg-id 49007EE6.5070707@gmx.net
обсуждение исходный текст
Ответ на Re: EXPLAIN CREATE TABLE AS  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: EXPLAIN CREATE TABLE AS  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> Peter Eisentraut <peter_e@gmx.net> writes:
>> It turns out you cannot EXPLAIN on CREATE TABLE AS, but it seems to work 
>> fine if I extend the grammar as below:
> 
> This seems to me to be something that will look like a wart, not a
> feature, from the user's point of view.  You can't explain CREATE TABLE,
> but you can explain CREATE TABLE AS?  It's just weird.  It feels to me
> like exposing an implementation artifact.

Isn't the whole point of EXPLAIN to expose implementation artifacts in 
the first place?  It shows the plan associated with a plannable 
statement.  Why are some statements plannable and some not?  Why can you 
explain DELETE and not TRUNCATE?  Why can you explain INSERT, what is 
plannable about that?  Ah, there is INSERT ... SELECT.  If you can plan 
INSERT, can you plan SELECT INTO, right?  Yes, that works.  But CREATE 
TABLE AS is the same, why won't that work?  Should we prohibit 
explaining SELECT INTO?  So you can't explain SELECT INTO, but you can 
explain SELECT?  It's all very weird.

So it's not like this is not already quite implementation-dependent.  We 
expose the information that we have and let the user process it. 
Someone who has advanced to the level of using EXPLAIN should be able to 
tell the difference, and those who are maximally confused won't be 
harmed by this addition any more than they already are.


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

Предыдущее
От: Dimitri Fontaine
Дата:
Сообщение: Re: EXPLAIN CREATE TABLE AS
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unicode escapes in literals