Updating only changed values in DB

Updating only changed values in DB

NicolasRibotNicolasRibot Posts: 4Questions: 2Answers: 0

Hi,

I'm using Editor with PHP and PostgreSQL.
When editing a table (14 columns) based on several other tables (1-n joins and n-m joins), a lot of queries are performed.
If I edit say 10 lines, it leads to 172 SQL queries performed, with many same SQL queries for FK tables.

Updating process can take several minutes though DB is quite small and queries launched directly against it run pretty fast (1s or so)

Is there a way to send/update only the changed fields automatically, or do I have to catch the preSubmit event and compare editor values before sending them ? In this case, will PHP editor work if it receives only a fragment of expected data (changed fields) ?

Thanks.
Nicolas

Answers

  • NicolasRibotNicolasRibot Posts: 4Questions: 2Answers: 0

    (hmm should have read the Editor's doc more thoroughly... it answers my question.)
    Will try to diff the editor.get() before and after changes and see if it boosts the edition process.

    Nicolas

This discussion has been closed.