From 1df585794e2d54a42728ba32d23e41ef3de961d1 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Thu, 14 Dec 2017 10:31:45 +0100 Subject: mnesia: Read schema user properties directly Doing a proper transaction handling of user properties (in current implmenentation) caused schema_transactions to be quadratic which caused huge startup times for nodes with many tables since the merge schema is a schema_transaction. Do a direct read instead, cheap but implies that the plugin changes will not be visible until the changes are commited and cannot be used later in same transaction, which was possible before if undocumented functions where used. --- lib/mnesia/src/mnesia_schema.erl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'lib') diff --git a/lib/mnesia/src/mnesia_schema.erl b/lib/mnesia/src/mnesia_schema.erl index 0e4017e4c3..bb5e38f7c1 100644 --- a/lib/mnesia/src/mnesia_schema.erl +++ b/lib/mnesia/src/mnesia_schema.erl @@ -952,19 +952,9 @@ get_index_plugins() -> get_schema_user_property(mnesia_index_plugins). get_schema_user_property(Key) -> - Tab = schema, - %% Must work reliably both within transactions and outside of transactions - Res = case get(mnesia_activity_state) of - undefined -> - dirty_read_table_property(Tab, Key); - _ -> - do_read_table_property(Tab, Key) - end, - case Res of - undefined -> - []; - {_, Types} -> - Types + case dirty_read_table_property(schema, Key) of + undefined -> []; + {_, Types} -> Types end. get_ext_types_disc() -> -- cgit v1.2.3