Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id B5A5432CB71 for ; Fri, 25 May 2012 20:14:16 -0300 (ADT) Received: from smtp.01.com ([199.36.142.181]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SY3i2-0002WI-N4 for pgsql-performance@postgresql.org; Fri, 25 May 2012 23:14:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 0F778294054 for ; Fri, 25 May 2012 18:14:01 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tgyCaLkOLW+S for ; Fri, 25 May 2012 18:14:00 -0500 (CDT) Received: from smtp.01.com (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id DEE862941D3 for ; Fri, 25 May 2012 18:14:00 -0500 (CDT) Received: from Sidney-Stratton.local (70-36-143-92.dsl.dynamic.sonic.net [70.36.143.92]) by smtp-out-1.01.com (Postfix) with ESMTPSA id B304D294054 for ; Fri, 25 May 2012 18:14:00 -0500 (CDT) Message-ID: <4FC01232.1090901@agliodbs.com> Date: Fri, 25 May 2012 16:13:54 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: Parallel (concurrent) inserts? References: In-Reply-To: X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/150 X-Sequence-Number: 46974 > I'm wondering if there is ia document describing which guarantees (if > any) PostgreSQL makes about concurrency for various operations? Speaking > in general (i.e. IO can handle it, number of CPU cores and client > threads is optimal), are fully concurrent operations (independant and > non-blocking) possible for: Yes, there's quite a bit of documentation. Start here: http://www.postgresql.org/docs/9.1/static/mvcc.html > 1) An unindexed table? Yes. > 2) A table with 1+ ordinary (default btree) indexes? (are there > constraints on the structure and number of indexes?) Yes. > 3) A table with 1+ unique indexes? Yes. Note that locking on the unique index may degrade concurrent throughput of the input stream though, since we have to make sure you're not inserting two different rows with the same unique indexed value simulatenously. It's work as you expect, though. > 4) A table with other objects on it (foreign keys, check constraints, etc.)? Yes. Also concurrent autonumber (sequence) allocations work fine. In fact, PostgreSQL has no non-concurrent mode, unless you count temp tables. -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com