couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From robertkowal...@apache.org
Subject [27/50] [abbrv] couchdb-mango git commit: Always use the DB name as the cache key
Date Tue, 03 Feb 2015 15:13:34 GMT
Always use the DB name as the cache key

mango_idx:list/1 accepts a #db{} in addition to a database name. When
the former is used it's often a stub record with a randomly generated
UUID in the #db_header. This really kills the cache hit rate ;)

BugzID: 42707


Project: http://git-wip-us.apache.org/repos/asf/couchdb-mango/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-mango/commit/7bad11f4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-mango/tree/7bad11f4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-mango/diff/7bad11f4

Branch: refs/heads/master
Commit: 7bad11f4a7add4a599f0f459627e8cf077b5c797
Parents: 58fc27c
Author: Adam Kocoloski <adam@cloudant.com>
Authored: Wed Dec 17 14:58:29 2014 -0500
Committer: Adam Kocoloski <adam@cloudant.com>
Committed: Wed Dec 17 14:58:29 2014 -0500

----------------------------------------------------------------------
 src/mango_idx.erl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-mango/blob/7bad11f4/src/mango_idx.erl
----------------------------------------------------------------------
diff --git a/src/mango_idx.erl b/src/mango_idx.erl
index c1bbe4c..0498e07 100644
--- a/src/mango_idx.erl
+++ b/src/mango_idx.erl
@@ -37,7 +37,7 @@
 
 
 list(Db) ->
-    {ok, Indexes} = ddoc_cache:open(Db, ?MODULE),
+    {ok, Indexes} = ddoc_cache:open(db_to_name(Db), ?MODULE),
     Indexes.
 
 recover(Db) ->


Mime
View raw message