diff options
author | Sverker Eriksson <[email protected]> | 2019-02-15 16:46:33 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2019-02-15 16:46:33 +0100 |
commit | 76da23bb4e06d62d91150e5c61a8deb37ff12e8f (patch) | |
tree | 216844aee264bff3356f63f0a2c6d9937d39d857 /lib/stdlib | |
parent | 480baa51c652ea51db35e47475808b07cfc77c7e (diff) | |
parent | 77cff6693158dc2ab20b798db9c124a2c82f5e2a (diff) | |
download | otp-76da23bb4e06d62d91150e5c61a8deb37ff12e8f.tar.gz otp-76da23bb4e06d62d91150e5c61a8deb37ff12e8f.tar.bz2 otp-76da23bb4e06d62d91150e5c61a8deb37ff12e8f.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/doc/src/ets.xml | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index 7594514b29..ff088de8ab 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -213,6 +213,21 @@ ets:insert(t, {3}), is not enabled. This can also only be a potential concern for <c>ordered_set</c> where the traversal order is defined.</p> </note> + <p>Traversals using <c>match</c> and <c>select</c> functions may not need to + scan the entire table depending on how the key is specified. A match + pattern with a <em>fully bound key</em> (without any match variables) will + optimize the operation to a single key lookup without any table traversal + at all. For <c>ordered_set</c> a <em>partially bound key</em> will limit the + traversal to only scan a subset of the table based on term order. A + partially bound key is either a list or a tuple with a prefix that is fully + bound. Example:</p> +<pre> +1> <input>T = ets:new(t,[ordered_set]), ets:insert(T, {"555-1234", "John Smith"}).</input> +true +2> <input>%% Efficient search of all with area code 555</input> +2> <input>ets:match(T,{[$5,$5,$5,$- |'$1'],'$2'}).</input> +[["1234","John Smith"]] +</pre> </section> <section> |