Shall I define index (A) and index (B), or index (A, B), or both?
问题 In my table I have two closely related columns A and B. What possible considerations shall I made to decide whether to create: index(A) and index(B), index(A, B), both of the above? How does this change if I: use only queries like where A = 5 and B = 10 (and never like where A = 5 ), also use queries like where A > 3 and A < 10 and B > 12 and B < 20 , often use order by (A, B) , often use group by (A, B) ? Note: I intentionally haven't provided more details about my particular case as I want