Question

I wanted check if i plan to use "erlang record" storing ability as schemaless store, what kind of performance impact i would have.

to be more clear:

I need to have table : person, age, gender,{other attributes, Marital status, Number of childeren....} the information about person may come with varying attributes. for example : if marital status is unmarried, i would not have attribute number of children for correspoding person.

Table Person should have varying number of coloumns. since Mnesia is schema based, was thinking on having table like:

person,age,gender,Attributes where attribute is list of [ key value pair of properties]. is it good idea to have such schema ?

what kind of query optimizations are possible for query like: fetch all persons with "Number of children=2".

would query response time impact be linear with number of records in table and number of attributes in each attributelist ?

Was it helpful?

Solution

Mnesia might not be the best fit for what you're trying to do. In principle the columns/record fields are fixed. Including a key-value list of extra attributes as you describe is commonly done, but it means you can't query efficiently on those extra fields: each query needs to iterate through the entire table, copy each record and check whether it fulfils the criteria.

would query response time impact be linear with number of records in table and number of attributes in each attributelist ?

Yes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top