4 ms·
I feel like the use of indexes is one of the least mysterious parts of databases performance.
by charcircuit 5y ago
I feel like the use of indexes is one of the least mysterious parts of databases performance.
- crispyambulance 5y agoI don't. Well, to be honest, for a long time I had just assumed that the database "took care" of that kind of stuff. In reality, the people who managed the database had indexed columns for us, and/or provided guard-rails for developer folks in the form of stored procedures. For a long time I never worried about indexes because I didn't have to. I still have not even the slightest idea what "a cursor" is. It's only when you _actually_ have to do it yourself that you learn, sometimes harshly, the nature of databases.
- dominotw 5y agoThere are things like ottertune that do this.
- ofrzeta 5y agoDoes it work? Seems it's a now a commercial enterprise that has sprung from a CMU DB group project. An old version's still on Github: https://github.com/cmu-db/ottertune https://github.com/cmu-db/ottertune They also had Peloton, a "self-driving SQL database management system", that's a dead project now.
- dkjaudyeqooe 5y agoA cursor lets you step through a table one row at a time. You can use it to move between rows and read and update them.
- tomnipotent 5y agoIn the sense that it's a sorted tree pointing to data in other trees, sure. But less obvious is how they're used by cost-based optimizers and in execution plans, which is where all the real nuance is.
- baq 5y agoSuperficially… being able to tell which index is missing or misconstructed from query plan isn’t always obvious and that’s where speed ups are usually the most needed.