Re: [GENERAL] Join efficiency

2009-09-02 Thread Sam Mason
On Wed, Sep 02, 2009 at 10:11:24PM +0900, tanjunhua wrote: > thanks for your response. > > >Maybe if you could describe what you want to do in English then the > >query would make a bit more sense. > I just want those records as the below rule: > 1. the record of which uid is 2, status is more tha

Re: [GENERAL] Join efficiency

2009-09-02 Thread tanjunhua
thanks for your response. Maybe if you could describe what you want to do in English then the query would make a bit more sense. I just want those records as the below rule: 1. the record of which uid is 2, status is more than 20, bpassword is 0 and realdelflag is 0 in tab_main; 1.1 the recor

Re: [GENERAL] Join efficiency

2009-09-02 Thread Sam Mason
On Wed, Sep 02, 2009 at 02:31:46PM +0900, tanjunhua wrote: > I > have the trouble that it cost me a lot of time when execute the select > syntax. the following is the select syntax and analyze result. > EXPLAIN ANALYZE SELECT count(Id) FROM (SELECT DISTINCT t1.Id AS Id FROM > tab_main t1, tab_

[GENERAL] Join efficiency

2009-09-01 Thread tanjunhua
Hello, everybody. In my project, I have a select syntax to get record summary between three tables. one of them is tab_main consist of 46 columns(with 27797 records), another is tab_user consist of 32 columns(with 3 records) and the last one is tab_property consist of 117 columns(with 30541 re

Re: [GENERAL] Join efficiency

2009-09-01 Thread tanjunhua
piled by GCC cc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) (1 row) - Original Message - From: "tanjunhua" To: Sent: Wednesday, September 02, 2009 2:31 PM Subject: [GENERAL] Join efficiency Hello, everybody. In my project, I have a select syntax to get record

Re: [GENERAL] Join efficiency

2004-09-01 Thread Tom Lane
"Russ Brown" <[EMAIL PROTECTED]> writes: > Is there any difference between these queries in terms of the speed of > planning or the quality of the plan untimately used? http://www.postgresql.org/docs/7.4/static/explicit-joins.html http://www.postgresql.org/docs/7.3/static/explicit-joins.html htt

Re: [GENERAL] Join efficiency

2004-09-01 Thread Michael Paesold
Russ Brown wrote: > >> SELECT * FROM a, b WHERE a.x=b.x; > >> SELECT * FROM a JOIN b ON a.x=b.x; > That being the case, would it be true to say that with recent versions of > PostgreSQL they both perform identically, meaning the second could be > considered preferable due to its self-documenting

Re: [GENERAL] Join efficiency

2004-09-01 Thread Richard Huxton
John Sidney-Woollett wrote: Does anyone know if there is a postgres shorthand for Oracle's (+) notation to denote an outer join? eg SELECT * from a, b where a.x = b.x (+) Just the standard LEFT JOIN ... afaik -- Richard Huxton Archonet Ltd ---(end of broadcast)

Re: [GENERAL] Join efficiency

2004-09-01 Thread John Sidney-Woollett
Does anyone know if there is a postgres shorthand for Oracle's (+) notation to denote an outer join? eg SELECT * from a, b where a.x = b.x (+) John Sidney-Woollett Richard Huxton wrote: Russ Brown wrote: I have always written queries with ordinary joins in this manner: SELECT * FROM a, b WHERE a.

Re: [GENERAL] Join efficiency

2004-09-01 Thread Richard Huxton
Russ Brown wrote: I have always written queries with ordinary joins in this manner: SELECT * FROM a, b WHERE a.x=b.x; However I recently saw an laternative syntax: SELECT * FROM a JOIN b ON a.x=b.x; Is there any difference between these queries in terms of the speed of planning or the quality of

Re: [GENERAL] Join efficiency

2004-09-01 Thread terry
) 441-9085 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Russ Brown > Sent: Wednesday, September 01, 2004 7:55 AM > To: [EMAIL PROTECTED] > Subject: [GENERAL] Join efficiency > > > Hello all, > > Recently a post on this

[GENERAL] Join efficiency

2004-09-01 Thread Russ Brown
Hello all, Recently a post on this list made me think a bit about the way in which I write my queries. I have always written queries with ordinary joins in this manner: SELECT * FROM a, b WHERE a.x=b.x; However I recently saw an laternative syntax: SELECT * FROM a JOIN b ON a.x=b.x; Is there any