Re: [BUGS] BUG #2429: Explain does not report object's schema

From: Cristiano Duarte <cunha17(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [BUGS] BUG #2429: Explain does not report object's schema
Date: 2006-05-17 14:19:01
Message-ID: e4fbce$2l1c$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Qingqing Zhou 2006-05-18 01:57:50 Re: BUG #2442: Problemas accessing DB in a multithread pross
Previous Message Carmen 2006-05-17 11:37:55 BUG #2442: Problemas accessing DB in a multithread pross

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephan Szabo 2006-05-17 14:19:45 Foreign key column reference ordering and information_schema
Previous Message Tom Lane 2006-05-17 14:11:39 Re: PL/pgSQL 'i = i + 1' Syntax