Re: [BUGS] BUG #2429: Explain does not report object's schema - Mailing list pgsql-hackers

From Cristiano Duarte
Subject Re: [BUGS] BUG #2429: Explain does not report object's schema
Date
Msg-id e4fbce$2l1c$1@news.hub.org
Whole thread Raw
In response to Re: [BUGS] BUG #2429: Explain does not report object's schema  ("Jim C. Nasby" <jnasby@pervasive.com>)
List pgsql-hackers
Alvaro Herrera wrote:

> Cristiano Duarte wrote:
> 
>> SQL table aliases doesn't help locating the real place where the table
>> is. If I have a table named "test" at the schema "place" and I do:
>> 
>> "EXPLAIN SELECT * FROM place.test mytest"
>> 
>> I will get:
>> 
>> "Seq Scan on test mytest"
>> 
>> With this output I know that "mytest" is an alias to "test", and that's
>> great, much helpful than aliases only, but, where is "test"?
> 
> Since you created the mytest alias, you sure know where it's pointing
> to.  
In fact I didn't create the alias, I've got the query already made from a
user function call, and now I have to know where the table is located. 

Also, the user may pass a query without the schema name and even on this
scenario, I need to know the schema name and the "real" table name.

> 
> In fact I'd argue that this should instead display 
> Seq Scan on mytest 
I agree with you if EXPLAIN should only be executed interactivelly(psql,
pgadmin3, etc). 

But, since you can execute EXPLAIN as a regular query to the database, you
may be "explaining" an user supplied query, and doing so, there is no way
to previously know what the aliases mean.

> 
> 
>> I don't see too much harm if the output was:
>> 
>> "Seq Scan on place.test mytest"
> 
> Not much harm there, but there will be plenty harm on other node types
> where the output is already too wide.
Jim C. Nasby suggested a verbosity level to EXPLAIN, using "VERBOSE". It may
solve this issue without harming other node types where the output is
already too wide.

Regards,

Cristiano Duarte


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/pgSQL 'i = i + 1' Syntax
Next
From: Stephan Szabo
Date:
Subject: Foreign key column reference ordering and information_schema