Use ets:select/2 to retrieve shards by name
authorBenjamin Anderson <b@banjiewen.net>
Sun, 10 Apr 2016 06:08:39 +0000 (23:08 -0700)
committerBenjamin Anderson <b@banjiewen.net>
Mon, 9 May 2016 21:20:56 +0000 (14:20 -0700)
commit130efcd6b0b6f9fa6403e131586dfbf003643074
tree5382283ccd295f9b6ad9db82a193dd542a6dc16c
parentd5e0a4a19de99b2c6a91c9de8a1bc120664e36d5
Use ets:select/2 to retrieve shards by name

The result of mem3_shards:for_db/1 on databases with high q values can
be very large, resulting in suboptimal performance for high-volume
callers.

mem3_sync_event_listener is only interested in a small subset of the
result of mem3_shards:for_db/1; moving this filter in to an ets:select/2
call improves performance significantly.

COUCHDB-2984
src/mem3_shards.erl
src/mem3_sync_event_listener.erl