Chen Yu
Chen Yu

Reputation: 4077

mnesia db query, multi key search at the same time

The table has only two column. One is key, the other is value. The key is like sequencial number from 1,2,3,...N. I want to search many values at the same time by providing the list of keys for saving time rather than one by one by calling mnesia:read/N. Is it possible? The key lists may be like '1, 21, 55' not have some rule.

Upvotes: 3

Views: 465

Answers (1)

user425720
user425720

Reputation: 3598

The table is really small, so non of ets:match nor select will make a difference. The only optimization I see is to use dirty_read and do not wrap in transaction each read.

I am not sure here, but due to the nature of mnesia linear hashing, there is no bulk read hidden API. If your keys can be totally random, it would not help anyway.

Upvotes: 1

Related Questions