X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 08833D1B23E for ; Tue, 29 Jun 2004 13:04:00 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 56288-07 for ; Tue, 29 Jun 2004 16:03:55 +0000 (GMT) Received: from tetra.ehpg.net (tetra.ehpg.net [216.218.206.34]) by svr1.postgresql.org (Postfix) with ESMTP id 564EED1B1EC for ; Tue, 29 Jun 2004 13:03:54 -0300 (ADT) Received: from adsl-67-122-136-119.dsl.irvnca.pacbell.net ([172.16.1.35]) [67.122.136.119]by tetra.ehpg.netwith asmtp(Exim 4.34 #1 (Gentoo Linux 1.4))id 1BfL6H-000245-PT; Tue, 29 Jun 2004 09:04:50 -0700 Message-ID: <40E192CC.90707@ehpg.net> Date: Tue, 29 Jun 2004 09:03:24 -0700 From: "Gavin M. Roy" User-Agent: Mozilla Thunderbird 0.7 (Windows/20040616) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Chris Cheston Cc: Christopher Kings-Lynne , pgsql-performance@postgresql.org Subject: Re: postgres 7.4 at 100% References: <1088397641.1105.10.camel@localhost> <17884.1088399982@sss.pgh.pa.us> <200406280947.59420.josh@agliodbs.com> <40E1266D.3040607@familyhealth.com.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus-Scanned: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/302 X-Sequence-Number: 7360 Is the from field nullable? If not, try "create index calllogs_from on calllogs ( from );" and then do an explain analyze of your query. Gavin Chris Cheston wrote: >ok i just vacuumed it and it's taking slightly longer now to execute >(only about 8 ms longer, to around 701 ms). > >Not using indexes for calllogs(from)... should I? The values for >calllogs(from) are not unique (sorry if I'm misunderstanding your >point). > >Thanks, > >Chris > >On Tue, 29 Jun 2004 16:21:01 +0800, Christopher Kings-Lynne > wrote: > > >>>live=# explain analyze SELECT id FROM calllogs WHERE from = 'you'; >>> QUERY PLAN >>>---------------------------------------------------------------------------------------------------------- >>> Seq Scan on calllogs (cost=0.00..136.11 rows=24 width=4) (actual >>>time=0.30..574.72 rows=143485 loops=1) >>> Filter: (from = 'you'::character varying) >>> Total runtime: 676.24 msec >>>(3 rows) >>> >>> >>Have you got an index on calllogs(from)? >> >>Have you vacuumed and analyzed that table recently? >> >>Chris >> >> >> >> > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > >