"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
