Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 19E68632AAE for ; Mon, 23 Mar 2009 16:49:37 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 06607-08 for ; Mon, 23 Mar 2009 16:49:31 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.234]) by mail.postgresql.org (Postfix) with ESMTP id 7C5CE632721 for ; Mon, 23 Mar 2009 16:49:35 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id l9so1963043rvb.43 for ; Mon, 23 Mar 2009 12:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=N+bi40DScIlnFDwmOslaZUgwIDA/cZvph+C4slwYrPk=; b=ITclGgc3UuvBZalxX3dPeyN6wcONgNMouIwfRu20n68x7JeWwP1QIA8R0EYKMsmw2z Tj924zCY3jk8aOJjMEV4QEtnH6pbE6jINNGjAabLawNesgvym8Eu51R1MKUSKLhwrWsu 2uw5NZZ8Efff/X98UXfJMAezcMnNISOJASsmQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=UPT/vkv1yJ1lwSYOUw7ECfWfCZK5LN1hwgqJhK/oCrMNmlaZ1zNahhNkXaMW9RjDSv 9crAPFJ+xPmDDuUguVqPpvrJ28+849LJhHg93CZRUUxK2JBMM/N0KuqhysFsvkJzH+Zt C9XahrAn37YwIpq+e0mBiqucerZbzy34PZ1pw= MIME-Version: 1.0 Received: by 10.114.168.15 with SMTP id q15mr5032226wae.56.1237837774186; Mon, 23 Mar 2009 12:49:34 -0700 (PDT) In-Reply-To: <49C7E42B.9070002@ca.com> References: <49C7E42B.9070002@ca.com> Date: Mon, 23 Mar 2009 15:49:34 -0400 Message-ID: Subject: Re: multiple threads inserting into the same table From: David Wilson To: Brian Cox Cc: "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/332 X-Sequence-Number: 33254 On Mon, Mar 23, 2009 at 3:34 PM, Brian Cox wrote: > The application log shows that 99652 rows are being inserted into relation > ts_stats_transet_user_daily. 5 threads are doing the inserts. The schema is > lengthy, but it has a synthetic primary key (ts_id int8 not null) and the > following constraints: How many indexes are there on ts_stats_transset_user_daily? Are these rows being inserted in individual insert statements, or are they batched in some fashion? What's the disk/cpu activity on your system look like? -- - David T. Wilson david.t.wilson@gmail.com