X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 568D19F9CAA for ; Wed, 14 Jun 2006 12:18:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 28061-07 for ; Wed, 14 Jun 2006 12:18:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id A32179FA60C for ; Wed, 14 Jun 2006 12:18:06 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 570515649C; Wed, 14 Jun 2006 10:18:05 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Wed, 14 Jun 2006 10:18:04 -0500 Date: Wed, 14 Jun 2006 10:18:04 -0500 From: "Jim C. Nasby" To: B?sz?rm?nyi Zolt?n Cc: Volkan YAZICI , pgsql-performance@postgresql.org Subject: Re: Precomputed constants? Message-ID: <20060614151804.GB34196@pervasive.com> References: <3167.213.163.11.81.1150282434.squirrel@www.dunaweb.hu> <20060614110713.GA2277@alamut.tdm.local> <3861.213.163.11.81.1150284610.squirrel@www.dunaweb.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3861.213.163.11.81.1150284610.squirrel@www.dunaweb.hu> X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060614:zboszor@dunaweb.hu::VtTZ6uvCZEmvcG+G:0000000000000000000 00000000000000000000000058kj X-Hashcash: 1:20:060614:yazicivo@ttnet.net.tr::GtdFVI9qEUEb0+sS:0000000000000000 0000000000000000000000001BY/ X-Hashcash: 1:20:060614:pgsql-performance@postgresql.org::QAMZj3YAAJFWkadJ:00000 0000000000000000000000001hI6 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200606/256 X-Sequence-Number: 19613 On Wed, Jun 14, 2006 at 01:30:10PM +0200, B?sz?rm?nyi Zolt?n wrote: > Replacing random() with a true constant gives me index scan > even if it's hidden inside other function calls. E.g.: The database has no choice but to compute random() for every row; it's marked VOLATILE. -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461