SEED-platform / seed

Standard Energy Efficiency Data (SEED) Platform™ is a web-based application that helps organizations easily manage data on the energy performance of large groups of buildings.
Other
111 stars 54 forks source link

Save Derived Column values to PropertyState #3438

Open perryr16 opened 2 years ago

perryr16 commented 2 years ago

Background

Derived Columns are loosely calculated as: derived_column_value = derived_column.evaluate(property_state)

Issue

Derived Column values are dynamically calculated on each inventory list page load and have a few known performance issues:

Saving derived column data to the database would increase performance and allow for more advanced filtering and sorting.

A potential solution:

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity within 60 days. It will be closed if no further activity occurs. Thank you for your contributions.

isalanglois commented 2 years ago

This will be addressed through #3430

haneslinger commented 1 year ago

https://github.com/SEED-platform/seed/issues/3430 is closed but the issue remains. reopening this one

haneslinger commented 1 year ago

A potential solution:

  • save the derived column values to a property state inside a new attribute dictionary called derived_data. This would be similar to 'extra_data' on the property_state
  • after a new derived column is saved, run a method to add derived_data to every property_state attached to a property_view
  • after a property is updated, or new data is uploaded run a method to update or refresh derived data
  • add a dropdown action on the inventory list for "refresh derived data"

I really like this idea. The fact it mirrors extra data so closely really does us a favor. I'm going to start documenting where logic needs to be added. To be updated.

Add column to derived_data:

kflemin commented 8 months ago

Some notes on use case:

haneslinger commented 8 months ago

right-o, ive done some benchmarking

develop cached derived columns
upload file 3s 103s
map 8s ~2min
finish mapping 53s ~2min
load inventory ~2s ~2s
kflemin commented 6 months ago

let's await the import performance updates and revisit this issue!

BenchmarkDC commented 4 months ago

Hi Katherine,

We were talking about this on a Clearly BEAM call and I was reviewing the development history. I wanted to clarify - is the plan to fully disallow derived columns referencing other derived columns? Or just not allow caching for derived columns that reference other derived columns?

Andrew, DC

kflemin commented 4 months ago

@BenchmarkDC, For simplicity we were thinking of disallowing derived columns referencing other derived columns (since the same functionality can be implemented with the raw columns). Especially for caching derived columns referencing other derived columns would make things complicated. But let me know if you think this is a problem!