How to count # of records in a table - Page 2
DBAsupport.com Forums - Powered by vBulletin
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: How to count # of records in a table

  1. #11
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    Originally posted by marist89
    ...I heard count(1) was faster...
    count(9)
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  2. #12
    Join Date
    Jan 2001
    Posts
    138
    Originally posted by marist89
    ...I heard count(1) was faster...
    Ya sure...Even I know that not to be the case...

    So, we don't have anything more efficient than a SELECT count(*)??

  3. #13
    Join Date
    Nov 2002
    Location
    New Delhi, INDIA
    Posts
    1,796
    count(0)
    Amar
    "There is a difference between knowing the path and walking the path."

    Amar's Blog  Get Firefox!

  4. #14
    Join Date
    Dec 2002
    Location
    Bangalore ( India )
    Posts
    2,434
    Originally posted by marist89
    ...I heard count(1) was faster...
    Ya .. some DBAz working/worked on 7.x still think that
    funky...

    "I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."

    "Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"

  5. #15
    Join Date
    Mar 2002
    Posts
    534
    could you display the execution plan to check if an index is used for the count or if it does a fts

  6. #16
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Originally posted by marist89
    ...I heard count(1) was faster...
    Count(NULL) shoud go even faster

  7. #17
    Join Date
    Jan 2001
    Posts
    3,131
    Once you go above 400 million, does an extra million really matter?

    Just tell them it is a "big mother f*&%ing table"

    MH

    I remember when this place was cool.

  8. #18
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You could always export the table and see how many rows it exported...
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  9. #19
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    how about creating a nice function-based, compressed index ...
    Code:
    create index my_index on my_table ('X') pctfree 0 compress;
    That ought to be reasonably small and quick to modify.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  10. #20
    Join Date
    Mar 2002
    Location
    Manchester, England
    Posts
    202
    what about a procedure that runs when the system is quiet and populates a count history table (table_name,sysdate,count(*)) they can then just look at that. Its also pretty useful for spotting growth trends and what not.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width