sql - How to check if a string is in a list of strings with a minimal disk/space usage? -


i have encountered question need compare string list of strings , determine if string in list(for example, check if string 'abc' in list of strings ['ab','bc','abc']). problem straight forward given assumption store whole list in clear text. when list gets bigger, few million/billion records, takes lot of space store list(especially if need regularly different lists). there anyway efficiently using minimum storage space(that don't need store whole list)?

(specifically question doing in sql table, have store column , index efficiency purpose)

check out trie data structure - it's designed you're trying accomplish minimal space, , fast up. here's article (you can find many more searching) trie prefix

i'm not sure how works goals of storing options in sql - store trie data structure in database


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -