10

Indexes to data in RAM are well-known and widely used. They are usually not called indexes, they are often called dictionaries, maps, hashmaps, associative arrays, or key-value stores. I am pretty sure you have heard of them. These data structures are useful for the same reason why disk-based indexes are useful for databases: to reduce the search time in a ...


4

Is all permutations of a string a good way to index full text search? Uhh, no. That is a very, very bad idea. What happens when someone puts a moderately long string into your database? Say... like your question. Making a database of stack exchange questions seems like a normal sort of thing to do. At time of writing, just the content of the question is ...


3

Is the purpose of the indexing data structures to address the limitations of disks? No. The purpose of using keys or indices with different types of data structures is to allow for O(1) access. The partitioning of data on disks and the organization of data into RAM are two vastly different subjects, though they have some crossover. If data is stored in RAM, ...


2

Yes, indexes are still essential for in-ram data, as soon as you have a large amount of data and need to find a particular item by looking it up with a key (rather than via its address). It's basically the same reason why you need indexes for disk-based data, the main difference is that RAM access is much fast, especially random access (Harddisks are ...


2

The most common indexes are balanced trees, where finding a partial match at the beginning is easy. A filesystem is not a good backing structure for any index because of the high overhead (I understand that you are doing this as a learning experience so performance doesn't matter as much) but certainly it's unsuitable for a tree as you need to access several ...


2

Creating indexes is more about use than simply because something is a foreign key. Indexes increase the cost of writing to the table so you need to be somewhat reserved about adding them blindly. You want indexes to be created on the columns that are used in the where/group by/order by/joins. Columns that are commonly returned in the select only are better ...


Only top voted, non community-wiki answers of a minimum length are eligible