Properties are currently stored in a separate table. To retrieve properties for a given node, the database has to scan this table for properties that may be scattered all over.
However, since there is almost no use case for accessing properties without the associated node, we may be better off storing properties in a JsonDict (from coaster.sqlalchemy). This will use PostgreSQL's efficient JSONB store (or JSON on older versions), falling back to TEXT on other databases.
Should querying on the basis of properties be required, they can also be indexed in PostgreSQL.
This will switch will remove a lot of code that currently serves to make the Node.properties object behave like a dictionary.
Properties are currently stored in a separate table. To retrieve properties for a given node, the database has to scan this table for properties that may be scattered all over.
However, since there is almost no use case for accessing properties without the associated node, we may be better off storing properties in a
JsonDict
(fromcoaster.sqlalchemy
). This will use PostgreSQL's efficientJSONB
store (orJSON
on older versions), falling back toTEXT
on other databases.Should querying on the basis of properties be required, they can also be indexed in PostgreSQL.
This will switch will remove a lot of code that currently serves to make the
Node.properties
object behave like a dictionary.