Current CTO exploring entrepreneurship on the side; coach; mentor; instructor.
Dedicated to promoting digital literacy and ideological diversity in tech.
A lot of this is going to be engine-dependant, but in almost all cases I can think of, string indices should be avoided for the purpose of searching and/or sorting.
In MYSQL, string operations are just integer operations, but there's a step of converting the strings to integers which degrades performance at scale.
MYSQL supports the FULLTEXT index type which indexes the entire string column. However, the larger the string is, the less performant the search will be unless you're searching for the exact, entire string (which rarely happens and defeats the purpose of a string index in the first place)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What about pre-segmentation of strings for
string containsoperators, probably just like how full-text-search in SQLite Virtual Table works?Currently not even understanding why hashtable is near O(1), but I believe
string startsWithoperator is just akin tointeger greater than?Now that you mentioned it, how do they work with best performances in relative large datasets?
Also, about
String indices, if I don't plan to make unique, it might be possible to optimize, by limiting index size, and looking up multiple times?A lot of this is going to be engine-dependant, but in almost all cases I can think of, string indices should be avoided for the purpose of searching and/or sorting.
In MYSQL, string operations are just integer operations, but there's a step of converting the strings to integers which degrades performance at scale.
MYSQL supports the FULLTEXT index type which indexes the entire string column. However, the larger the string is, the less performant the search will be unless you're searching for the exact, entire string (which rarely happens and defeats the purpose of a string index in the first place)