Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 76AF82E00C8 for ; Thu, 6 Mar 2008 04:16:20 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 48547-05 for ; Thu, 6 Mar 2008 04:16:11 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.246]) by postgresql.org (Postfix) with ESMTP id 677882E00BA for ; Thu, 6 Mar 2008 04:16:14 -0400 (AST) Received: by an-out-0708.google.com with SMTP id c36so387830ana.33 for ; Thu, 06 Mar 2008 00:16:13 -0800 (PST) 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:mime-version:content-type; bh=hSGvkAvzEAeDR/3/X9q+/Sp8CdsjrM6z3f/K05owvHo=; b=oa4UGn7YYtH7L++uRa4CcLqqS5Q8F0+SXrVxsHxw7xOniKOmZV0k0YROxxL0XBiawkC6ZNiw4L4jpAoKVS3815gqF61N4GORpZHaScCR5xlfWc+q89Q24TEYrylMAJf9dBZkTH6rxkXpucyPBaEU8XMCD1fRs7dtrHmncynZF9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=RqCmo2ynH1AWhG70NhfhErjLzksGGmHI8DW4+VWK33mRW8vuMVpgMWtluHe/87SbkcHKZOpsvWAY5UPlPSXTp83GAvo7dlMXip79LwVrkBx5ZnBpANbSFDTKvR6x8lEu5tsrQHr4kCOkFN/0ISwdX1w12/bntKJ/C7YNFMzLOrs= Received: by 10.100.212.13 with SMTP id k13mr9562498ang.76.1204791373611; Thu, 06 Mar 2008 00:16:13 -0800 (PST) Received: by 10.100.105.20 with HTTP; Thu, 6 Mar 2008 00:16:13 -0800 (PST) Message-ID: Date: Thu, 6 Mar 2008 13:46:13 +0530 From: "sathiya psql" To: pgsql-performance@postgresql.org Subject: index usage makes problem MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3738_4682413.1204791373563" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/109 X-Sequence-Number: 29063 ------=_Part_3738_4682413.1204791373563 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I had 50 lakh records in my table... while counting that am using that row in where condition... which makes problem, cpu is waiting for device... Debian OS, postresql 7.4, 50 lakh records. Query is EXPLAIN ANALYZE select count(call_id) from call_log where call_id > 1; while seeing the top, cpu is waiting for i/o, and without this call_id condition if i do EXPLAIN ANALYZE select count(oid) from call_log where oid > 1; it executed in 21 seconds.... ------=_Part_3738_4682413.1204791373563 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I had 50 lakh records in my table...

while counting that am using that row in where condition... which makes problem, cpu is waiting for device...

Debian OS, postresql 7.4, 50 lakh records.

Query is

EXPLAIN ANALYZE select count(call_id) from call_log where call_id > 1;

while seeing the top, cpu is waiting for i/o, and without this call_id condition if i do
       EXPLAIN ANALYZE select count(oid) from call_log where oid > 1;
it executed in 21 seconds....

------=_Part_3738_4682413.1204791373563--