From oracle-l-bounce@freelists.org Thu Jul 8 09:28:45 2004 Return-Path: Received: from air189.startdedicated.com (root@localhost) by orafaq.com (8.11.6/8.11.6) with ESMTP id i68ESJD08507 for ; Thu, 8 Jul 2004 09:28:29 -0500 X-ClientAddr: 206.53.239.180 Received: from turing.freelists.org (freelists-180.iquest.net [206.53.239.180]) by air189.startdedicated.com (8.11.6/8.11.6) with ESMTP id i68ES9608440 for ; Thu, 8 Jul 2004 09:28:19 -0500 Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 6C68372CB21; Thu, 8 Jul 2004 09:09:24 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05267-55; Thu, 8 Jul 2004 09:09:24 -0500 (EST) Received: from turing (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 8E4EB72CB28; Thu, 8 Jul 2004 09:09:23 -0500 (EST) Received: with ECARTIS (v1.0.0; list oracle-l); Thu, 08 Jul 2004 09:07:58 -0500 (EST) X-Original-To: oracle-l@freelists.org Delivered-To: oracle-l@freelists.org Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4850972C0F5 for ; Thu, 8 Jul 2004 09:07:58 -0500 (EST) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05272-21 for ; Thu, 8 Jul 2004 09:07:58 -0500 (EST) Received: from smtp.wangtrading.com (smtp.wangtrading.com [167.206.68.5]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id CD56E72C0E1 for ; Thu, 8 Jul 2004 09:07:57 -0500 (EST) Received: from imap (Not Verified[192.168.9.50]) by smtp.wangtrading.com with NetIQ MailMarshal (v5.5.5.8) id ; Thu, 08 Jul 2004 10:30:06 -0400 Received: from mladen.wangtrading.com (mladen.wangtrading.com [::ffff:192.168.3.47]) (TLS: TLSv1/SSLv3,256bits,AES256-SHA) by imap with esmtp; Thu, 08 Jul 2004 10:31:53 -0400 Received: from mladen (localhost.localdomain [127.0.0.1]) by mladen.wangtrading.com (8.12.8/8.12.8) with ESMTP id i68EVqqg026711 for ; Thu, 8 Jul 2004 10:31:53 -0400 Date: Thu, 8 Jul 2004 10:31:52 -0400 From: Mladen Gogala To: oracle-l@freelists.org Subject: Re: Difference between count(1) and count(*) Message-ID: <20040708143152.GM17716@mladen.wangtrading.com> References: Mime-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Disposition: inline In-Reply-To: (from Peter.Miller@cogent-dsn.com on Thu, Jul 08, 2004 at 09:40:17 -0400) X-Mailer: Balsa 2.0.17 Lines: 54 X-Mime-Autoconverted: from 8bit to 7bit by courier 0.42 X-Virus-Scanned: by amavisd-new at freelists.org X-archive-position: 4655 X-ecartis-version: Ecartis v1.0.0 Sender: oracle-l-bounce@freelists.org Errors-To: oracle-l-bounce@freelists.org X-original-sender: mladen@wangtrading.com Precedence: normal Reply-To: oracle-l@freelists.org X-list: oracle-l X-Virus-Scanned: by amavisd-new at freelists.org On 07/08/2004 09:40:17 AM, Peter Miller wrote: > 1,749,951 rows returned in every case > > count(rowid) - approx 3.2 secs > count(obj#) - approx 3.5 secs > count(1) - approx 3.6 secs > count(*) - approx 3.6 secs > count(rownum)- approx 4.6 secs > count(source)- approx 8.6 secs > Connected to: Oracle9i Enterprise Edition Release 9.2.0.5.0 - Production With the Partitioning option JServer Release 9.2.0.5.0 - Production SQL> set timing on SQL> select count(*) from wi_cumulative; COUNT(*) ---------- 12148659 Elapsed: 00:00:20.16 SQL> select count(rowid) from wi_cumulative; COUNT(ROWID) ------------ 12148659 Elapsed: 00:00:20.62 SQL> select count(1) from wi_cumulative; COUNT(1) ---------- 12148659 Elapsed: 00:00:21.52 SQL> select count(null) from wi_cumulative; COUNT(NULL) ----------- 0 Elapsed: 00:00:19.12 SQL> Tanel's favorite way of counting differed from the real count for only about 12 million rows, and it wasn't that much faster, so the difference doesn't justify lack of precision. -- Mladen Gogala Oracle DBA Note: This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Wang Trading LLC and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity. ---------------------------------------------------------------- Please see the official ORACLE-L FAQ: http://www.orafaq.com ---------------------------------------------------------------- To unsubscribe send email to: oracle-l-request@freelists.org put 'unsubscribe' in the subject line. -- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------