I do not fully understand indexes and would like some precisions.
I have a table, named posts, which overtime might become very big.
Each post belongs to a category and a language, through 2 columns category_id and lang
If I create indexes on the columns category_id and lang, does this mean that the posts table will be “organized”/”classified” in mysql by “blocs” of category_id and lang, allowing a better performance of the selection of data when I precise a category_id and/or a lang in my query…?
Which type of index should be created then ?
I hope I’m clear enough here…
What an index does is create a “shadow” table, consisting of only the index values, so it only has to look through the index to find what you’re looking for.
If you’re doing a query, with a where like this:
You will need an index on Zipcode and Phone.
If the query is only:
You will need to index zipcode only.