Re: Why does this SQL work? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Why does this SQL work?
Date
Msg-id 20150512084253.GA21806@depesz.com
Whole thread Raw
In response to Why does this SQL work?  (Anil Menon <gakmenon@gmail.com>)
List 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 by date:

Previous
From: Craig Ringer
Date:
Subject: Re: [BDR] Node Join Question
Next
From: "Wayne E. Seguin"
Date:
Subject: Re: [BDR] Node Join Question