Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6950B9FB357 for ; Thu, 28 Sep 2006 15:27:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 74290-07 for ; Thu, 28 Sep 2006 18:27:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from globalrelay.com (mail1.globalrelay.com [216.18.71.77]) by postgresql.org (Postfix) with ESMTP id 2169D9FA3B0 for ; Thu, 28 Sep 2006 15:27:20 -0300 (ADT) X-Virus-Scanned: Scanned by GRC-AntiVirus Gateway X-GR-Acctd: YES Received: from [67.90.96.2] (HELO DaveEMachine) by globalrelay.com (CommuniGate Pro SMTP 4.2.3) with ESMTP id 106888638; Thu, 28 Sep 2006 11:27:18 -0700 From: "Dave Dutcher" To: "'Carlo Stonebanks'" , Subject: Re: Performace Optimization for Dummies Date: Thu, 28 Sep 2006 13:26:49 -0500 Message-ID: <00d001c6e32b$aaaa8a80$8300a8c0@tridecap.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6626 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 In-Reply-To: Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.315 tagged_above=0 required=5 tests=SARE_MILLIONSOF X-Spam-Level: X-Archive-Number: 200609/393 X-Sequence-Number: 21079 > -----Original Message----- > From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org] On Behalf Of Carlo Stonebanks > Subject: [PERFORM] Performace Optimization for Dummies >=20 > At this early stage in the project, we are initializing our portal's=20 > database with millions of rows of imported data in over 50 different=20 > flattened tables; each table's structure is unique to the=20 > data provider.=20 > This requires a pretty complex import program, because the=20 > data must be=20 > matched semantically, not literally. Even with all of the expression=20 > matching and fuzzy logic in the code,our performance=20 > statistics show that=20 > the program spends over 75% of its time in SQL queries=20 > looking for matching=20 > and/or duplicate data. >=20 > The import is slow - and degrades as the tables grow.=20 So your program first transforms the data and then inserts it? And it = is the transforming process which is running select statements that is = slow? If that is the case you could use duration logging to find the slow = select statement, and then you could post an EXPLAIN ANALYZE of the select. =20 One question off the top of my head is are you using regular expressions = for your fuzzy logic if so do your indexes have the right operator classes? (see http://www.postgresql.org/docs/8.1/static/indexes-opclass.html) Dave