I plan to write a series of posts about databases internals. In order to make it easily perceivable, I’ll be writing a NoSQL DB from scratch in Ruby. No doubts that it’s not the best fit for database development, but it’s extremely readable and will help us a lot. This one will be about why may you want to have an index and what is a Hash index.
UPD. I decided to not continue this series because it takes too much effort to investigate deep enough to explain, but it had got much fewer views and likes than more applicable ones. Probably will return to this topic once, but not now.
Hey folks! Today we will try to find some text in our collection. And then we will add text indexes there and behold, how it become better (or not). Let’s grab a beer and start.
As you may know, PostgreSQL provides you four index types: B-tree, Hash, GiST and GIN. They all named the way that if you don’t know ’em you’ll never get which one do you need. In MongoDB indexes are named in a more human-readable way. Here they are:
1. Single field index.
2. Compound index.
3. Multikey index.
4. Text index.
5. Hashed index.
6. 2dsphere, 2d, geoHaystack indexes.
Since I’m using Mongo for more than a year now, I worked with few of them and will elucidate you the most commonly used ones.
I just finished reading the book Python for Data Analysis. Here I want to share some points which were interesting for me, some examples and also my opinion on this book.