Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3625D650296 for ; Tue, 26 Aug 2008 12:30:16 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 88672-08-3 for ; Tue, 26 Aug 2008 12:30:04 -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.226]) by postgresql.org (Postfix) with ESMTP id E744F650274 for ; Tue, 26 Aug 2008 12:29:16 -0300 (ADT) Received: by rv-out-0506.google.com with SMTP id b25so3296127rvf.43 for ; Tue, 26 Aug 2008 08:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=KZv3oOkrzxx5phqiC9PH3fNslVcVwNddB8gu2+XGV7U=; b=syaKeZqEknjmjiyu6EMu1v6akisINlFt63H1HKorILyvRW4xoHlSNrxZUklBEEb7AI yKKKQmDpc8Dy3Oph8ZtST96V4ezPYFlg5zUSllqVi1N9KqYr/vnYb6X1SN3J7+e9nyPu Evo/b+GY4M8nBz96CmsZS9rawYIdkNbtYEcaQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ihDRNPeJMDo8dLin/k9JRSWzR5G+ccf2jJPtCCnA5LKQPkRFhid9XzlAUF17f7PG3U kH5NYD9C8IpHvnUfolJSBcb3erX69ohVFnXlPISssWBc01LsjTE3sHLCCwHTfdLNC/bY N3dQc2WdCV3T6MSP64UaWjBmac6eWseY9Dsk0= Received: by 10.140.133.9 with SMTP id g9mr2907326rvd.235.1219764555403; Tue, 26 Aug 2008 08:29:15 -0700 (PDT) Received: by 10.141.197.1 with HTTP; Tue, 26 Aug 2008 08:29:15 -0700 (PDT) Message-ID: Date: Tue, 26 Aug 2008 09:29:15 -0600 From: "Scott Marlowe" To: "Matthew Wakeling" Subject: Re: Large number of tables slow insert Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1775c5ea0808221841u746862e3h1b721ea82fdb7794@mail.gmail.com> 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: 200808/326 X-Sequence-Number: 31207 On Tue, Aug 26, 2008 at 6:50 AM, Matthew Wakeling wrote: > On Sat, 23 Aug 2008, Loic Petit wrote: >> >> I use Postgresql 8.3.1-1 to store a lot of data coming from a large amount >> of sensors. In order to have good >> performances on querying by timestamp on each sensor, I partitionned my >> measures table for each sensor. Thus I create >> a lot of tables. > > As far as I can see, you are having performance problems as a direct result > of this design decision, so it may be wise to reconsider. If you have an > index on both the sensor identifier and the timestamp, it should perform > reasonably well. It would scale a lot better with thousands of sensors too. Properly partitioned, I'd expect one big table to outperform 3,000 sparsely populated tables.