I like to think that I know enough theory, but I have little experience optimizing the database in the real world. I would like to know points of view, thoughts or experiences.
Imagine a scenario like:
Table A Key: c1, c2, c3, c4 Index: c7, c3, c2
Table B Key: c1, c2, c3, c4 Index: c1, c5
All are not clustered. Tables contain 40 fields. They eat daily at night and have some updates throughout the day.
Table A, if more queries benefit from the key than the index, can the index affect negatively? Since insert / delete you need to update 2 indexes instead of 1.
Table B has an additional field in the index that is not present in the key.
Can a request use c1, c5
Use this key ?: Key: c1, c2, c3, c4, c5
So that this index can be lost.
What effect does the field order have? Key: c1, c2, c3 Key: c3, c1, c2
A typical scenario for me is process_date, client_number, operation. And it feeds on a bunch of data every day (process_date).