Re: Why does this SQL work?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Why does this SQL work?
Дата
Msg-id 20150512084253.GA21806@depesz.com
обсуждение исходный текст
Ответ на Why does this SQL work?  (Anil Menon <gakmenon@gmail.com>)
Список pgsql-general
On Tue, May 12, 2015 at 04:07:52PM +0800, Anil Menon wrote:
> Thank you very much - looks like I will have to prefix all cols.

You should anyway.
Queries with unaliased columns make it impossible to analyze without
in-depth knowledge of the database.

Consider:

select c1, c2, c3, c4, c5
from t1 join t2 using (c6)
where c7 = 'a' and c8 < now() and c9;

which fields belong to which tables? what indexes make sense? it's
impossible to tell. if the column references were prefixed with table
name/alias - it would become possible, and easy, even, to figure out
what's going on.

depesz


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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: [BDR] Node Join Question
Следующее
От: "Wayne E. Seguin"
Дата:
Сообщение: Re: [BDR] Node Join Question