aquametalabs / aquameta

Web development platform built entirely in PostgreSQL
GNU General Public License v3.0
1.1k stars 52 forks source link

bundle: optimize stage_row_field and offstage_field_changed #116

Open erichanson opened 5 years ago

erichanson commented 5 years ago

bundle.stage_row_field calls meta.field_id_literal_value() once per field on each row on the stage. This requires a query to the table for every field, which is making bundle.commit() run very slow. Optimize this to instead issue only one query per row_id in bundle.stage_row. Probably using row_to_json().