X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3AA8ED1D53C for ; Tue, 27 Jan 2004 15:58:59 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 26490-01 for ; Tue, 27 Jan 2004 11:58:32 -0400 (AST) Received: from ram.rentec.com (ram.rentec.com [192.5.35.66]) by svr1.postgresql.org (Postfix) with ESMTP id 94BAAD1D547 for ; Tue, 27 Jan 2004 11:58:27 -0400 (AST) Received: from rentec.com (bison.rentec.com [192.5.35.87]) by ram.rentec.com (8.12.1/8.12.1) with ESMTP id i0RFwUCL013885; Tue, 27 Jan 2004 10:58:30 -0500 (EST) Message-ID: <40168AA5.6040702@rentec.com> Date: Tue, 27 Jan 2004 10:58:29 -0500 From: Alan Stange User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.6b) Gecko/20031218 X-Accept-Language: en-us, en MIME-Version: 1.0 To: PC Drew Cc: "Leeuw van der, Tim" , pgsql-performance@postgresql.org Subject: Re: Insert Times References: <82CEDAA6A559DB48A373FC3090F2560F356689@mail.ibsncentral.com> In-Reply-To: <82CEDAA6A559DB48A373FC3090F2560F356689@mail.ibsncentral.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/280 X-Sequence-Number: 5454 PC Drew wrote: >I tested this out and saw no improvement: > > I'd still suspect some class loading issues and HotSpot compilation issues are polluting your numbers. Try using a PreparedStatement to another table first in order to make sure that classes bytecode has been loaded. There are some command line options to the JVM to have it print out some status info when it is loading classes and compiling methods; you might want to turn on those options as well. -- Alan >EXPLAIN ANALYZE SELECT * FROM one; >Seq Scan on one (cost=0.00..20.00 rows=1000 width=404) (actual time=0.04..0.50 rows=51 loops=1) >Total runtime: 0.75 msec >EXPLAIN ANALYZE SELECT * FROM one; >Seq Scan on one (cost=0.00..20.00 rows=1000 width=404) (actual time=0.06..0.50 rows=51 loops=1) >Total runtime: 0.64 msec >EXPLAIN ANALYZE SELECT * FROM one; >Seq Scan on one (cost=0.00..20.00 rows=1000 width=404) (actual time=0.04..0.40 rows=51 loops=1) >Total runtime: 0.54 msec >EXPLAIN ANALYZE SELECT * FROM one; >Seq Scan on one (cost=0.00..20.00 rows=1000 width=404) (actual time=0.04..0.41 rows=51 loops=1) >Total runtime: 0.54 msec >EXPLAIN ANALYZE SELECT * FROM one; >Seq Scan on one (cost=0.00..20.00 rows=1000 width=404) (actual time=0.04..0.41 rows=51 loops=1) >Total runtime: 0.53 msec >EXPLAIN ANALYZE INSERT INTO one (id, msg) VALUES (1, 'blah'); >Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.01..0.02 rows=1 loops=1) >Total runtime: 0.85 msec >EXPLAIN ANALYZE INSERT INTO one (id, msg) VALUES (1, 'blah'); >Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.02..0.02 rows=1 loops=1) >Total runtime: 0.15 msec >EXPLAIN ANALYZE INSERT INTO one (id, msg) VALUES (1, 'blah'); >Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.02..0.02 rows=1 loops=1) >Total runtime: 0.14 msec >EXPLAIN ANALYZE INSERT INTO one (id, msg) VALUES (1, 'blah'); >Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.02..0.02 rows=1 loops=1) >Total runtime: 0.12 msec >EXPLAIN ANALYZE INSERT INTO one (id, msg) VALUES (1, 'blah'); >Result (cost=0.00..0.01 rows=1 width=0) (actual time=0.01..0.02 rows=1 loops=1) >Total runtime: 0.12 msec > > > >-----Original Message----- >From: Leeuw van der, Tim [mailto:tim.leeuwvander@nl.unisys.com] >Sent: Tue 1/27/2004 12:38 AM >To: PC Drew; pgsql-performance@postgresql.org >Cc: >Subject: RE: [PERFORM] Insert Times > >Hi, > >My personal feeling on this is, that the long time taken for the first query >is for loading all sorts of libraries, JVM startup overhead etc. > >What if you first do some SELECT (whatever), on a different table, to warm >up the JVM and the database? > >regards, > >--Tim > >THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY >MATERIAL and is thus for use only by the intended recipient. If you received >this in error, please contact the sender and delete the e-mail and its >attachments from all computers. > > > > >---------------------------(end of broadcast)--------------------------- >TIP 8: explain analyze is your friend > >