Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 95CA76500E1 for ; Thu, 16 Oct 2008 05:55:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 80165-03 for ; Thu, 16 Oct 2008 05:55:02 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from batyskaf.batory.org.pl (mail.batory.org.pl [62.89.72.199]) by postgresql.org (Postfix) with ESMTP id DDA1A64FEAF for ; Thu, 16 Oct 2008 05:54:59 -0300 (ADT) Received: from pancernik.batory.org.pl (pancernik.batory.lan [192.168.30.210]) (authenticated bits=0) by batyskaf.batory.org.pl (8.13.8/8.13.8) with ESMTP id m9G8slPh017815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 16 Oct 2008 10:54:47 +0200 Message-ID: <48F70157.7010601@batory.org.pl> Date: Thu, 16 Oct 2008 10:54:47 +0200 From: Tomasz Ostrowski User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: =?ISO-8859-2?Q?Mikkel_H=3Fgh?= CC: pgsql-general Subject: Re: Drupal and PostgreSQL - performance issues? References: <48F4F053.1060201@hagander.net> <7438A981-4B6A-4E5A-A1E0-50432CDEFB00@hoegh.org> <48F6EE94.8010904@batory.org.pl> <4BE94DFB-8917-4175-9083-7DEABC30BD7F@hoegh.org> In-Reply-To: <4BE94DFB-8917-4175-9083-7DEABC30BD7F@hoegh.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 192.168.30.2 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/660 X-Sequence-Number: 138909 On 2008-10-16 10:34, Mikkel Hogh wrote: > It's not only to avoid one query, but to avoid one query every time > drupal_lookup_path() is called (which is every time the system builds > a link, which can be dozens of time on a page). Oh, $count is static. My bad. Using count for testing for empty table is stupid nonetheless. There is an issue report with lengthy discussion on drupal.org: http://drupal.org/node/196862 And a proposed patch: http://drupal.org/files/issues/drupal_lookup_path-5.x.patch.txt which uses "limit 1". This patch is not applied though. I don't know why. Please retest with this patch. And keep the CC to the list in your messages. Regards Tometzky -- ...although Eating Honey was a very good thing to do, there was a moment just before you began to eat it which was better than when you were... Winnie the Pooh