Update statistics * vs. update statistics

Tue, 03 Jun 2003 19:18:06 -0700

Hi all,
 
I had no doubts that the statement update statistics * is equals to the
 
update statistics <table-name> for all the tables in the particular
 
schema. However I had a query that demonstrated slow performance:
 

"SELECT Entity.description, Entity.descriptionalias, Entity.entitytypeid,

EntityType.description, EmailBody.text_offset, EmailBody.text_length,

Entity.id FROM

EmailBodyNamedEntity EmailBody, NamedEntity Entity,

NamedEntityType EntityType, EmailStats WHERE

EmailStats.emailid = 530094 AND EmailBody.namedentityid = Entity.id

AND

EmailBody.emailstatsid = EmailStats.id AND EntityType.id =

Entity.entitytypeid

ORDER BY EmailBody.text_offset"

The execution plan started with table scan for entitytype table that it's

definetely not the most optimal plan for this query.

After I run "update statistics *" I found no improvements. However after I

run the update statistics <tablename> one by one for all the tables that

are used in the query the execution plan has been changed and the

execution time reduced to 0.020 sec (was 8.2 sec before)

I would be grateful if someone could explain what the difference between

the  "update statistics *" and "update statistics <table name>"

Does the  order of the update statistics statements matter?

Thanks in advance,

Dmitri Lyssenko, Nuix Pty. Ltd.

 

 

 



Yahoo! Plus - For a better Internet experience

Reply via email to