X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id BCCBF925D84 for ; Thu, 29 May 2003 13:21:21 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 23852-10 for ; Thu, 29 May 2003 13:21:20 -0400 (EDT) Received: from utahisp.com (pop3.cyber-wire.com [66.239.12.3]) by developer.postgresql.org (Postfix) with ESMTP id 1BE09925D8F for ; Thu, 29 May 2003 13:21:20 -0400 (EDT) Received: from chad [63.230.8.76] by utahisp.com (SMTPD32-8.00) id A1B12EF50108; Thu, 29 May 2003 11:21:53 -0600 Message-ID: <004601c32606$884af960$32021aac@chad> From: "Chad Thompson" To: "pgsql-sql" Subject: Index scan never executed? Date: Thu, 29 May 2003 11:19:57 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Declude-Sender: chad@weblinkservices.com [63.230.8.76] X-Declude-Spoolname: D41b12ef50108873f.SMD X-Note: This E-mail was scanned by Declude JunkMail (www.declude.com) for spam. X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/553 X-Sequence-Number: 13718 I have never been very good at reading these query plans, but I have a bit of a problem w/ my query. So any help is appreciated. The query is fairly self explanitory i think. 2 tables, call_results ( 6.5 Million records ) and lists ( 11 Million records ) weblink=# explain analyze weblink-# select count(*) as count weblink-# from call_results cr join lists l on cr.list_id = l.id weblink-# where cr.project_id = '55' weblink-# and cr.start_time between '4/4/2003 0:0' and now() weblink-# and l.list_of_lists_id = '691'; QUERY PLAN ---------------------------------------------------------------------------- ---- ------------------------------------------------------------------------- Aggregate (cost=2519.58..2519.58 rows=1 width=16) (actual time=110715.45..110715.46 rows=1 loops=1) -> Nested Loop (cost=0.00..2519.58 rows=1 width=16) (actual time=110715.43..110715.43 rows=0 loops=1) -> Index Scan using start_time_idx on call_results cr (cost=0.00..2021.00 rows=164 width=8) (actual time=110715.42..110715.42 rows=0 loops=1) Index Cond: ((start_time >= '2003-04-04 00:00:00-07'::timestamp with time zone) AND (start_time <= now())) Filter: (project_id = 55::bigint) -> Index Scan using lists_pkey on lists l (cost=0.00..3.03 rows=1 width=8) (never executed) Index Cond: ("outer".list_id = l.id) Filter: (list_of_lists_id = 691::bigint) Total runtime: 110747.58 msec (9 rows) The big thing I dont understand is why it tells me (never executed) on lists_pkey. I also dont see where all the time is being taken up. I thought that (actual time=110715.42..110715.42) meant from millisecond this... TO millisecond that, but that would mean that this index scan took no time. So as you can see I am very confused. :-) TIA for any suggestions on how to make this query faster. Chad PS I have run vacuum full and analyze as reciently as last night :-)