Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 70D202E005D for ; Wed, 11 Jun 2008 07:37:46 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 04182-06 for ; Wed, 11 Jun 2008 07:37:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mailrelay.edis.at (mailrelay.edis.at [81.223.48.5]) by developer.postgresql.org (Postfix) with ESMTP id DBDB52E003B for ; Wed, 11 Jun 2008 07:37:35 -0300 (ADT) Received: from localhost.localdomain (91.83.0.221.pool.invitel.hu [::ffff:91.83.0.221]) (AUTH: CRAM-MD5 zb@cybertec.at, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by mailrelay.edis.at with esmtp; Wed, 11 Jun 2008 12:35:56 +0200 id 000F2016.484FAA8C.00006EB6 Message-ID: <484FAA8A.6040406@cybertec.at> Date: Wed, 11 Jun 2008 12:35:54 +0200 From: Zoltan Boszormenyi User-Agent: Thunderbird 2.0.0.14 (X11/20080501) MIME-Version: 1.0 To: tv@fuzzy.cz CC: PostgreSQL Performance , Hans-Juergen Schoenig Subject: Re: Scalability question References: <484FA134.7030807@cybertec.at> <13093.217.77.161.17.1213179341.squirrel@sq.gransy.com> In-Reply-To: <13093.217.77.161.17.1213179341.squirrel@sq.gransy.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/46 X-Sequence-Number: 30396 tv@fuzzy.cz írta: >> Hi, >> >> I got a question about scalability in high volume insert situation >> where the table has a primary key and several non-unique indexes >> on other columns of the table. How does PostgreSQL behave >> in terms of scalability? The high volume of inserts comes from >> multiple transactions. >> >> Best regards, >> Zoltán Böszörményi >> > > Well, that's a difficult question as it depends on hardware and software, > but with a proper tunning the results may be very good. Just do the basic > PostgreSQL tuning and then tune it for the INSERT performance if needed. > It's difficult to give any other recommendations without a more detailed > knowledge of the problem, but consider these hints: > > 1) move the pg_xlog to a separate drive (so it's linear) > 2) move the table with large amount of inserts to a separate tablespace > 3) minimize the amount of indexes etc. > > The basic rule is that each index adds some overhead to the insert, but it > depends on datatype, etc. Just prepare some data to import, and run the > insert with and without the indexes and compare the time. > > Tomas > Thanks. The question is more about theoretical working. E.g. if INSERTs add "similar" records with identical index records (they are non-unique indexes) does it cause contention? Because these similar records add index tuples that supposed to be near to each other in the btree. -- ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH http://www.postgresql.at/