Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 22181475E23 for ; Wed, 15 Jan 2003 23:35:22 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 880EF475DC0 for ; Wed, 15 Jan 2003 23:35:21 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id h0G4Z05u011548; Wed, 15 Jan 2003 23:35:00 -0500 (EST) To: "Roman Fail" Cc: josh@agliodbs.com, pgsql-performance@postgresql.org Subject: Re: 7.3.1 New install, large queries are slow In-reply-to: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BFD@pos_pdc.posportal.com> References: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BFD@pos_pdc.posportal.com> Comments: In-reply-to "Roman Fail" message dated "Wed, 15 Jan 2003 15:30:55 -0800" Date: Wed, 15 Jan 2003 23:35:00 -0500 Message-ID: <11547.1042691700@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/130 X-Sequence-Number: 777 "Roman Fail" writes: > Thanks to everyone for the quick replies! I'm sure that my lack of > skill with SQL queries is the main problem. What's strange to me is > how MSSQL takes my bad queries and makes them look good anyway. It > must have a real smart planner. I think more likely the issue is that your use of JOIN syntax is forcing Postgres into a bad plan. MSSQL probably doesn't assign any semantic significance to the use of "a JOIN b" syntax as opposed to "FROM a, b" syntax. Postgres does. Whether this is a bug or a feature depends on your point of view --- but there are folks out there who find it to be a life-saver. You can find some explanations at http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/explicit-joins.html > Is it pretty much universally accepted that I should drop all my > foreign keys? No. They don't have any effect on SELECT performance in Postgres. They will impact update speed, but that's not your complaint (at the moment). Don't throw away data integrity protection until you know you need to. regards, tom lane