X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 57EF79FA2C8; Thu, 11 May 2006 18:01:54 -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 82824-05; Thu, 11 May 2006 18:01:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- 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 9625E9FA278; Thu, 11 May 2006 18:01:45 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 2C1C056427; Thu, 11 May 2006 16:01:44 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 11 May 2006 16:01:41 -0500 Date: Thu, 11 May 2006 16:01:41 -0500 From: "Jim C. Nasby" To: Zeugswetter Andreas DCP SD Cc: PFC , Greg Stark , Tom Lane , pgsql-performance@postgresql.org, pgsql-hackers@postgresql.org Subject: Re: [HACKERS] Big IN() clauses etc : feature proposal Message-ID: <20060511210141.GP99570@pervasive.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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:060511:zeugswettera@spardat.at::1N1XJqGWo7olJL79:00000000000000 0000000000000000000000000P1D X-Hashcash: 1:20:060511:lists@peufeu.com::JjLUEovSkgFvFa9e:0GPdf X-Hashcash: 1:20:060511:gsstark@mit.edu::YXTqhgw6evKGGCnp:002ya9 X-Hashcash: 1:20:060511:tgl@sss.pgh.pa.us::KBsDLFmggR4HH/qt:00000000000000000000 0000000000000000000000005UMr X-Hashcash: 1:20:060511:pgsql-performance@postgresql.org::pkpwx+FXoqwCtCMT:00000 00000000000000000000000008iI X-Hashcash: 1:20:060511:pgsql-hackers@postgresql.org::1DG9vgGnqRY6+jp9:000000000 0000000000000000000000006mHC X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/300 X-Sequence-Number: 19087 On Thu, May 11, 2006 at 09:55:15AM +0200, Zeugswetter Andreas DCP SD wrote: > > > Something else worth considering is not using the normal > > catalog methods > > for storing information about temp tables, but hacking that together > > would probably be a rather large task. > > But the timings suggest, that it cannot be the catalogs in the worst > case > he showed. > > > 0.101 ms BEGIN > > 1.451 ms CREATE TEMPORARY TABLE tmp ( a INTEGER NOT NULL, b INTEGER > NOT > > NULL, c TIMESTAMP NOT NULL, d INTEGER NOT NULL ) ON COMMIT DROP > > 1.4 seconds is not great for create table, is that what we expect ? milliseconds... :) Given the amount of code and locking that it looks like is involved in creating a table, that might not be unreasonable... > > 0.450 ms INSERT INTO tmp SELECT * FROM bookmarks ORDER BY annonce_id > DESC > > LIMIT 20 > > 0.443 ms ANALYZE tmp > > 0.365 ms SELECT * FROM tmp > > 0.310 ms DROP TABLE tmp > > 32.918 ms COMMIT > > > > CREATING the table is OK, but what happens on COMMIT ? I hear > the disk > > seeking frantically. > > The 32 seconds for commit can hardly be catalog related. It seems the > file is > fsynced before it is dropped. I'd hope that wasn't what's happening... is the backend smart enough to know not to fsync anything involved with the temp table? ISTM that that transaction shouldn't actually be creating any WAL traffic at all. Though on the other hand there's no reason that DROP should be in the transaction at all; maybe that's gumming things up during the commit. -- 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