Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 14 Aug 2002 @ 20:25:15 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Performance of a count(*) query?
 
From:   Michael Larkins

Hi Michael:

You should check your EXPLAIN to verify this, but it should be faster if you use a column in the aggregation that is a secondary index that cannot be NULL, instead of the count(*). Remember, an EXPLAIN does not actually perform the operation, but indicates and estimate of resourses and rows involved. If nothing else, it can traverse the subtable (index rows) that are much smaller and therefore, more of them in a block. This might help it finish quicker. Then, compare that with the EXPLAIN of your count(*) for potential improvements.

Additionally, it might help if you have statistics on the table based on the primary or secondary indices.


God Luck,

Mike



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023