Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 53B644766F0 for ; Thu, 16 Jan 2003 08:17:35 -0500 (EST) Received: from mail.libertyrms.com (unknown [209.167.124.227]) by postgresql.org (Postfix) with ESMTP id CCB854766BC for ; Thu, 16 Jan 2003 08:17:34 -0500 (EST) Received: from andrew by mail.libertyrms.com with local (Exim 3.22 #3 (Debian)) id 18Z9tq-0006BP-00 for ; Thu, 16 Jan 2003 08:17:38 -0500 Date: Thu, 16 Jan 2003 08:17:38 -0500 From: Andrew Sullivan To: pgsql-performance@postgresql.org Subject: Re: 7.3.1 New install, large queries are slow Message-ID: <20030116081738.B22344@mail.libertyrms.com> Mail-Followup-To: Andrew Sullivan , pgsql-performance@postgresql.org References: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BFD@pos_pdc.posportal.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <9B1C77393DED0D4B9DAA1AA1742942DA0E4BFD@pos_pdc.posportal.com>; from rfail@posportal.com on Wed, Jan 15, 2003 at 03:30:55PM -0800 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/140 X-Sequence-Number: 787 On Wed, Jan 15, 2003 at 03:30:55PM -0800, Roman Fail wrote: > 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. > Andrew Sullivan wrote: > >First, the performance of foreign keys is flat-out awful in Postgres. > >I suggest avoiding them if you can. > > I don't have any problem getting rid of FKs, especially if it might > actually help performance. The nightly data import is well-defined Sorry, I think I sent this too quickly. FKs make no difference to SELECT performance, so if you're not doing updates and the like at the same time as the SELECTs, there's no advantage. So you should leave the FKs in place. > I think this is the most likely problem. I've read through Chapter > 10 of the 7.3 docs, but I still don't feel like I know what would > be a good order. How do you learn this stuff anyway? Trial and > error? Sorry, but yes. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada M2P 2A8 +1 416 646 3304 x110