sqlite db compact

48 views
Skip to first unread message

wilco van hoboken

unread,
Jan 24, 2022, 4:46:42 PM1/24/22
to weewx-user
after using weewx for many years my database has grown to 80mb. in the database a lot of values are calculated and written with 10 digits behind the comma. is there a simple way to batch edit the database and round the values to eg. 2 digits behind the comma.

wilco van hoboken

unread,
Jan 24, 2022, 4:49:11 PM1/24/22
to weewx-user
i realise that the info is incomplete. it is a sqlite database

p q

unread,
Jan 24, 2022, 5:21:44 PM1/24/22
to weewx...@googlegroups.com
I can't imagine you're going to save any reasonable amount of space by doing this. The database still needs to hold a real, no matter how many digits. 


--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/668cd183-dc3e-4e0d-a0f2-4846e3faa3aan%40googlegroups.com.


--
Peter Quinn
(415)794-2264

Tom Keffer

unread,
Jan 24, 2022, 6:36:34 PM1/24/22
to weewx-user
Real values are stored as 8-byte IEEE floating point numbers in a SQLite database. Rounding them will not make any difference. 

Also, an 80 MB database is actually quite small. Mine is well over 300 MB and doing fine. Don't worry about it.

On Mon, Jan 24, 2022 at 1:49 PM 'wilco van hoboken' via weewx-user <weewx...@googlegroups.com> wrote:
--
Reply all
Reply to author
Forward
0 new messages