Re: [SQL] SELECT multiple tables with same fields

From: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
To: avalon(at)teleweb(dot)at, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] SELECT multiple tables with same fields
Date: 1999-09-06 15:36:36
Message-ID: l03130307b3f98f0fffce@[147.233.159.109]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

At 18:43 +0300 on 29/08/1999, Dipl.-Ing. Thomas Schallar wrote:

> But if I add fields, than I have to add
> them to each of the SELECT statements also, that they won't be missed
> off. That's boaring und faulty.

One may argue about that. I was told in the past never to use * except when
"just checking", i.e. when running something ad-hoc in psql. In
applications, it is always recommended to write the names of the fields
explicitly, which makes sure you don't include fields which are not really
needed, and you know exactly what you got back and why you got it.

The minute you use an equijoin, you have one field which is truly
redundant, not just by name, but also in value. I think that writing a
query is something you do once, but many many redundant bytes will be
transmitted as a result of being lazy during the writing of the query.

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Herouth Maoz 1999-09-06 15:59:13 Re: [SQL] select ... from ... where ... ~* 'C++'
Previous Message Herouth Maoz 1999-09-06 15:25:13 Re: [SQL] indexes using datetime