Database / Mnesia intermediate to advanced Interview questions
What is mnesia:all_keys/1 used for?
mnesia:all_keys(Table) returns every primary key currently stored in a table, run inside a
transaction (or a dirty context via mnesia:dirty_all_keys/1) — a quick way to enumerate a
table's contents by key without writing a match specification.
mnesia:transaction(fun() -> mnesia:all_keys(person) end). %% -> {atomic, [1, 2, 3, 4]}
It's convenient for small-to-moderate tables (iterating configuration, listing registered sessions), but it
does mean scanning the whole table's key space, so on a very large table a more targeted
select/2 query with an actual filter condition is usually a better fit than pulling every key and
filtering client-side afterward.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
