Below listed some common performance tips for extract queries.
- Extract required columns only and specify in the query, avoid select *
- Extract required rows only. delta only
- Avoid unnecessary sorting operations
- union vs union all
- distinct, group by, order by: use only when necessary
- Avoid transformation logic in the extract queries. These logic should be offloaded to ETL engine.
- Indexes
- proper where clause;
- use AND;
- avoid OR/NOT/<>/NOT IN
- be careful using wildcard and range
- create proper indexes
- maintain indexes regularly
- Consider "Read uncommitted" (AKA dirty read, NOLOCK). Learn and use it carefully.
- Use native utility and driver to execute your query. They are usually tuned for better performance.
No comments:
Post a Comment