diff options
author | Christophe Romain <christophe.romain@process-one.net> | 2008-07-25 09:12:44 +0000 |
---|---|---|
committer | Christophe Romain <christophe.romain@process-one.net> | 2008-07-25 09:12:44 +0000 |
commit | c68baa953e2c0c0419b9eebddb8f385a02d00874 (patch) | |
tree | 9811ff793d91ac7fb9612f487a1c7fad9bbfbc03 /src/mod_pubsub/nodetree_default.erl | |
parent | * doc/guide.tex: Include example PAM configuration file (diff) |
Speedup startup with many pubsub nodes (EJAB-669)
SVN Revision: 1491
Diffstat (limited to 'src/mod_pubsub/nodetree_default.erl')
-rw-r--r-- | src/mod_pubsub/nodetree_default.erl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mod_pubsub/nodetree_default.erl b/src/mod_pubsub/nodetree_default.erl index 6dec6c5e..36b763df 100644 --- a/src/mod_pubsub/nodetree_default.erl +++ b/src/mod_pubsub/nodetree_default.erl @@ -70,8 +70,7 @@ init(_Host, _ServerHost, _Opts) -> mnesia:create_table(pubsub_node, [{disc_copies, [node()]}, - {attributes, record_info(fields, pubsub_node)}, - {index, [type,parentid]}]), + {attributes, record_info(fields, pubsub_node)}]), NodesFields = record_info(fields, pubsub_node), case mnesia:table_info(pubsub_node, attributes) of [host_node, host_parent, info] -> ok; % old schema, updated later by pubsub @@ -115,7 +114,7 @@ get_nodes(Key) -> %% Node = mod_pubsub:pubsubNode() %% From = mod_pubsub:jid() get_subnodes(Host, Node, _From) -> - mnesia:index_read(pubsub_node, {Host, Node}, #pubsub_node.parentid). + mnesia:match_object(#pubsub_node{parentid = {Host, Node}, _ = '_'}). %% @spec (Host, Index) -> [pubsubNode()] | {error, Reason} %% Host = mod_pubsub:host() |