Forum Moderators: open

Message Too Old, No Replies

Postgresql database SELECT syntax

just after a little thumbs up or down please

         

proper_bo

9:36 am on Nov 4, 2005 (gmt 0)

10+ Year Member



I have a very quick question that you can elaberate on as much or as little as you like.
I have searched for the answer but to no avail.

When selecting from a postgresql database are the following both acceptable and which is faster?

SELECT u.* FROM "user" u WHERE lower(username) = blah

SELECT * FROM "user" WHERE lower(username) = blah

thank you.

coopster

11:02 pm on Nov 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



The syntax in both queries look fine to me at first glance. The first query is prefixing the column list with the ALIASed table name while the second is using a simpler syntax. I'm not certain there is going to be a speed difference but if you do not need the ALIAS I would use the latter query.