From: Alan Gutierrez <ajglist@izzy.net>
To: pgsql-sql@postgresql.org
Subject: Re: good style?
Date: Fri, 21 Feb 2003 13:54:32 +0000 (UTC)
Message-ID: <slrnb5cctd.cme.ajglist@localhost.localdomain> (raw)
References: <3E5629EE.6000406@polonium.de>
In article <3E5629EE.6000406@polonium.de>, Rafal Kedziorski wrote:
> hi,
>
> I have 8 tables and this query:
>
> select u.users_id, m.name as mandant_name, u.login_name, u.password,
> u.first_name, u.last_name, u.creation_date, g.name as groups_name,
> ae.acl_entry_id, a.name as acl_name, p.name as permission_name
> from mandant m, users_2_groups u2g, groups g, users u, permission p,
> acl a, acl_entry ae, groups_2_acl_entry g2ae
> where m.mandant_id = u.mandant_id and
> u2g.groups_id = g.groups_id and
> u2g.users_id = u.users_id and
> g2ae.groups_id = g.groups_id and
> g2ae.acl_entry_id = ae.acl_entry_id and
> ae.acl_id = a.acl_id and
> ae.permission_id = p.permission_id
>
> I'm not using JOIN for get this information. would be JOIN a better sql
> programming style? faster?
Better style, yes. Whitespace would help also.
Faster, maybe. If you use join clauses you will be able to take control
over your query, specifying what gets joined when.
--
Alan Gutierrez - ajglist@izzy.net
http://khtml-win32.sourceforge.net/ - KHTML on Windows
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: ajglist@izzy.net
Subject: Re: good style?
In-Reply-To: <slrnb5cctd.cme.ajglist@localhost.localdomain>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox