Efficiently retrieve many small changing elements #2154
-
I'm using Dexie.js (svelte backend) to build a kind of special kind of spreadsheet, and I have a table that contains items like:
Now, I'm wondering what is the most (reasonably) efficient way to get these often-changing cells (I may have thousands of them, possibly more) to show them in my spreadsheet. I can think of 2 options:
Any advice? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would suggest to do one query per cell component or possibly by row. If one cell is updated, only that query will rerun. But if you have one large query, it would rerun when any cell changes. You could combine it with a query in parent component doing db.cells.where("tab").equals(tabID)).primaryKeys() to find which cells that exists (don't know if that makes sense in your case though) |
Beta Was this translation helpful? Give feedback.
I would suggest to do one query per cell component or possibly by row. If one cell is updated, only that query will rerun. But if you have one large query, it would rerun when any cell changes.
You could combine it with a query in parent component doing
to find which cells that exists (don't know if that makes sense in your case though)