Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id E2A769FB250 for ; Thu, 19 Oct 2006 15:59:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 35739-06 for ; Thu, 19 Oct 2006 15:59:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.175]) by postgresql.org (Postfix) with ESMTP id 8DE0A9FA37A for ; Thu, 19 Oct 2006 15:59:26 -0300 (ADT) Received: by ug-out-1314.google.com with SMTP id 30so479371ugc for ; Thu, 19 Oct 2006 11:59:25 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EW16snnbMGXia2Oab6r1vTDEt2rIcGxQzeTf3tBNyKgdxvtE0P87ztMdzhue/YoT5qFrmbInDIa14MH/p1oh1Ny9L2UqGzkT8XQw7C1by02UxwQFVn6Jsnx1G1ymrl3hgr+MKenflW3AeYbECu32tZ9w4rRrzSB0pb/Mh0d1SpE= Received: by 10.78.188.19 with SMTP id l19mr469353huf; Thu, 19 Oct 2006 11:59:25 -0700 (PDT) Received: by 10.78.35.18 with HTTP; Thu, 19 Oct 2006 11:59:25 -0700 (PDT) Message-ID: Date: Thu, 19 Oct 2006 14:59:25 -0400 From: "Merlin Moncure" To: "Jens Schipkowski" Subject: Re: DB Performance decreases due to often written/accessed table Cc: pgsql-performance@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.215 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/419 X-Sequence-Number: 21548 On 10/19/06, Jens Schipkowski wrote: > On Thu, 19 Oct 2006 19:32:22 +0200, Merlin Moncure > > 1. your database design is the real culprit here. If you want things > > to run really quickly, solve the problem there by normalizing your > > schema. denomalization is the root cause of many, many, problems > > posted here on this list. > Believe it is normalized. We also seperated configuration and runtime > data. And this is a runtime table. > This table holds short living data for devices to be registered by a > registration server. The INSERTs are triggered by external devices. The > master data tables are perfectly normalized too. What you are seeing is > not the real column names. I changed it due to readability. attr* have > really different names and meanings. A "twin" (in real, initiator/member > of the same conferencing group) is defined by these attributes. Due to > high flexibility of this system (serverside configuration/ deviceside > configuration for runtime) there is no other way to normalize. ok, fair enough =) still, it feels odd that you are relating two tables on all 6 attributes. istm there is something more elegant possible, hard to say. > > 2. barring that, the above query will run fastest by creating > > multi-column indexes on regtwin (attr*) fields. and reg(attr*). the > > real solution to problems like this is often proper idnexing, > > especially multi column. saying indexes take to long to build is like > > saying: 'i have a problem, so i am going to replace it with a much > > worse problem'. > I will index it. Just prepared the test and will run it tomorrow. > > 3. try where exists/not exists instead of where in/not in > Did try it, before I switched to NOT IN. It was 10 times slower. double check that when properly indexed. merlin