You are viewing a single comment's thread from:

RE: STEEMIT 2017 Round UP – Analyzing the ‘Travel’ Category

in #utopian-io7 years ago (edited)

Nice stats as usual, @paulag.

Some small hints to improve your query performances:

  • avoid using SELECT * unless you really need all columns to be returned. You are downloading all comments' body, which is a huge amount data that turns to be useless for stats.

  • CONVERT(datetime,'01/01/2017')
    better to use CONVERT(DATE,'2017-01-01') to avoid datetime locale issue with day and month.

  • ( created >= CONVERT(datetime,'01/01/2017') AND created< CONVERT(datetime,'01/01/2018'))
    YEAR(created) = 2017 will do exactly the same and is way faster.

  • category in ('travel')
    better to use category = 'travel' to avoid the query optimizer to uselessly create an enumerator which contains only 1 element. Not a big deal, but best practice.

Hope that help ;)

Sort:  

thank you @acrange. SQL is not my think and I am learning as so I, so thanks for the tips and please feel free to keep them coming.