Are there some basic principles/best practice for CREATE INDEX in N1QL?
Using INDEX can increase query efficiency,but If I am using wrong INDEX , or unnecessarily INDEX maybe cause query Inefficient.
I has read brief introduction to query planning,it is good introduction for understanding query planing.
but I am still confused in CREATE INDEX to increase query efficiency.
As I understand,
- I should make my N1QL to using KeyScan first,
- then I should also CREATE INDEX base on my where clause (As query planing shows, reduce FILTER operation,increase IndexScan operation?)?
- When use KeyScan(such as JOIN operation),make sure add more filter condition as possible?
- may be avoid to use some function?
May be a blog included following topic about INDEX will be good:
- For a given N1QL, How should I analyze N1QL to design INDEX?
- How should I choose index If I have more than one INDEX CREAT choice?
- How should I trace INDEX efficiency when a query execute？
- some basic principles/best practice?