Description
I am back :) After #28, I can now successfully connect to my DB. However, I have noticed some performance degradation when the target DB has a lot of data.
For context, I have a TimescaleDB database for storing IOT sensor data. Currently, the table has around 25 000 entries, and is only growing by the hour.
I saw in the tauri
code, that the data is being retrieved by doing a SELECT *
, which does make sense for smaller amounts of data. Now I do realise that this might not be the exact "target market" / use case for TableX (to view data in DBs with large amounts of data), but it would still be cool to use it.
Now I must confess, I'm not super well versed in Rust, so at this stage I don't have a proposed solution, apart from ideas:
- Perhaps the get_rows data retrieval function can somehow be paginated? I am not sure if
SQLx
even provides a way to do this. Even so, I assume it would require a bit of a rethink on the data retrieval queries/functions.
- This could be applied to the frontend as well, as the frontend seems to struggle with such large amounts of data. Perhaps some form of virtualisation in the rendering of the table rows could be a possible solution? Or at the very least, having paginated data being retrieved from Tauri could also help with initial performance concerns.
I am definitely keen to helping come up with solutions/doing research on possible solutions, so let me know :) Or, if this is out of scope of your vision for TableX, that is also (obviously) perfectly fine :)
For debugging purposes, here is my docker-compose.yml
setup:
version: "3"
db:
container_name: pih-rs-db
image: timescale/timescaledb:latest-pg16
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5439:5432"
restart: always
volumes:
- db:/var/lib/postgresql/data
volumes:
db:
driver: local
I have a (still very, very incomplete) Axum project that uses the docker setup mentioned above. If you want/need more information on the DB schemas & structure of the tables to help with creating/setting up a similar DB setup, you can check the initial migration file