X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 3440CD1B4FC for ; Mon, 29 Sep 2003 16:33:04 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 12623-06 for ; Mon, 29 Sep 2003 13:32:36 -0300 (ADT) Received: from news.hub.org (unknown [64.117.224.194]) by svr1.postgresql.org (Postfix) with ESMTP id A81E8D1B4EC for ; Mon, 29 Sep 2003 13:32:35 -0300 (ADT) Received: from news.hub.org (host-64-117-224-194.altec1.com [64.117.224.194] (may be forged)) by news.hub.org (8.12.9/8.12.9) with ESMTP id h8TGWZhM009113 for ; Mon, 29 Sep 2003 16:32:35 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id h8TGA3Y5002996 for pgsql-performance@postgresql.org; Mon, 29 Sep 2003 16:10:03 GMT From: Christopher Browne X-Newsgroups: comp.databases.postgresql.performance Subject: Re: avoiding seqscan? Date: Mon, 29 Sep 2003 11:12:55 -0400 Organization: Hub.Org Networking Services Lines: 27 Message-ID: <60vfrbzkzs.fsf@dev6.int.libertyrms.info> References: <95900000.1064782481@palle.girgensohn.se> <3F7766B3.4030705@bigfoot.com> <180710000.1064841936@durian.pingpong.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1003 (Gnus v5.10.3) XEmacs/21.4 (Rational FORTRAN, linux) Cancel-Lock: sha1:6QNJw1BqVlUQlGhapAbWmM2GNn8= To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/361 X-Sequence-Number: 3727 girgen@pingpong.net (Palle Girgensohn) writes: > Will that make a difference? From what I've seen, it does not make > much difference, but I have seen queries speed up when rewritten > explicit joins. I guess it depends on other things, but is it really > so that the explicit joins are bad somehow? Do you have any pointers > to documentation about it, if so? The problem is that if you expressly specify the joins, the query optimizer can't choose its own paths. And while that may not be better at the moment, it is quite possible that when you upgrade to a newer version, those queries, if "not join-specified," could immediately get faster. I would expect that the query that uses implicit joins will be clearer to read, which adds a little further merit to that direction. That goes along with the usual way that it is preferable to optimize things, namely that you should start by solving the problem as simply as you can, and only proceed to further optimization if that actually proves necessary. Optimization efforts commonly add complexity and make code more difficult to maintain; that's not the place to start if you don't even know the effort is necessary. -- (format nil "~S@~S" "cbbrowne" "libertyrms.info") Christopher Browne (416) 646 3304 x124 (land)