Optimize the Query Performance
To optimize query performance, follow these guidelines:
- Perform
GROUP BY
on the server whenever available. For instance, Crystal Reports gives you the option to group on the server as opposed to the client. - Use
DISTINCT
to eliminate duplicate rows. - Be specific when specifying tag names. For instance, when using wildcards, be as specific as possible.
- Limit the duration between start and end times.
- Get as precise a data type as possible to improve storage efficiency and allow reporting tools such as Power BI or Crystal Reports to properly format the data in reports.
- Do not rely on
TOP
orROWCOUNT
to optimize performance because they do not change the load on the archive or network but instead they just limit what is returned to the caller.