Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Keith Medcalf
That does not make any sense at all. How are you deleting old rows? The easiest way is to use the table rowid ... delete from data where rowid < (select max(rowid) - 20 from data); insert into data (... data but not rowid ...) values (...); This will explode after you have inserted

Re: [sqlite] sqlite sync over network

2019-12-05 Thread Jens Alfke
> On Dec 5, 2019, at 8:05 AM, George wrote: > > Changes -> bidirectional. All terminals can save to db. Amount of collected > data it's not big and frequency between readings will be minimum 2sec. When > we push more readings. Data itself it's very small. Like reading temperature > from a

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Zhu, Liang [AUTOSOL/ASSY/US]
According to the SQLlite.org, the purpose of vacuum is as follows, VACUUM command rebuilds the database file, repacking it into a minimal amount of disk space. I am trying to resolving an issue, I am keeping the record count in each row for the table with 20 row, After the table fill up

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Richard Hipp
On 12/5/19, Simon Slavin wrote: > > VACUUM should not be saving you any space. It might, depending on what he is doing. If a single page of the database holds (say) 30 rows of data, and the OP deletes 10 rows from that page, that leaves some empty space on the page. That empty space is reused

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Simon Slavin
On 5 Dec 2019, at 8:07pm, Zhu, Liang [AUTOSOL/ASSY/US] wrote: > We are using Journal_mode=delete, sqlite3_close(). Please check that when all your connections are closed, all temporary files are deleted. So if your database is called 'database.sql' then there should be no other file

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Zhu, Liang [AUTOSOL/ASSY/US]
We are using Journal_mode=delete, sqlite3_close(). Liang -Original Message- From: sqlite-users On Behalf Of Simon Slavin Sent: Thursday, December 5, 2019 2:04 PM To: SQLite mailing list Subject: Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum? On 5 Dec 2019,

Re: [sqlite] Query freezing on latest SQLite 3.30.1 build

2019-12-05 Thread David Raymond
The mailing list strips off all attachments, so you'll have to provide another place to get that. Alternatively could you post the schema here as text, along with the explain query plan output from the slow version and from a fast version? -Original Message- From: sqlite-users On

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Roman Fleysher
A side note about VACUUM: If I remember correctly, tables which do not have INTEGER PRIMARY KEY will have their rowid column reassigned. Be careful if you are using rowid. Roman From: sqlite-users on behalf of Simon Slavin Sent: Thursday, December 5, 2019

[sqlite] Query freezing on latest SQLite 3.30.1 build

2019-12-05 Thread Clovis Ribeiro,MyABCM
Folks, The following query, when executed against the attached database using SQLite 3.30.1 (running on Windows OS) will take forever to execute. If we remove all columns from both tables that are not actually used in the query, it is executed in milliseconds. SELECT COUNT(*) FROM (SELECT

Re: [sqlite] Enable Or Disable Extension Loading

2019-12-05 Thread Jose Isaias Cabrera
Keith Medcalf, on Thursday, December 5, 2019 02:24 PM, wrote... > On Thursday, 5 December, 2019 11:39, Jose Isaias Cabrera, on > >Just to be sure... > > > >The function, > > > >int sqlite3_enable_load_extension(sqlite3 *db, int onoff); > > > >enables or disables a database to allow or disallow

Re: [sqlite] Enable Or Disable Extension Loading

2019-12-05 Thread Keith Medcalf
On Thursday, 5 December, 2019 11:39, Jose Isaias Cabrera asked: >Just to be sure... > >The function, > >int sqlite3_enable_load_extension(sqlite3 *db, int onoff); > >enables or disables a database to allow or disallow the loading of >extensions[1]. Once it's set, will it stay on? Or does one

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread David Raymond
SQLite is pretty good at using free space inside the file. So if inserting something is going to run you out of space, then it's going to run you out of space whether the file was previously vacuumed or not. Also reminder that when vacuum is run, SQLite makes a brand new copy of the database,

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Simon Slavin
On 5 Dec 2019, at 6:31pm, Zhu, Liang [AUTOSOL/ASSY/US] wrote: > If I do not do Vacuum, my database size just keep raising, eventually the > database size gets to over 90% of storage size, I can save data to the > database any more. VACUUM should not be saving you any space. And VACUUM

Re: [sqlite] sqlite sync over network

2019-12-05 Thread Simon Slavin
On 5 Dec 2019, at 4:48pm, George wrote: > We have an app already done in Qt on all terminals. Sqlite it's already used > by this app. When a terminal makes up a SQL INSERT command to add new data to the database, have it also save this command to a file. That's the file you send to the

[sqlite] Enable Or Disable Extension Loading

2019-12-05 Thread Jose Isaias Cabrera
Greetings! Just to be sure... The function, int sqlite3_enable_load_extension(sqlite3 *db, int onoff); enables or disables a database to allow or disallow the loading of extensions[1]. Once it's set, will it stay on? Or does one need to be turn it on every time one connects to the

Re: [sqlite] [EXTERNAL] Re: what is the optimized way to do the vaccum?

2019-12-05 Thread Zhu, Liang [AUTOSOL/ASSY/US]
If I do not do Vacuum, my database size just keep raising, eventually the database size gets to over 90% of storage size, I can save data to the database any more. Thank you, Liang -Original Message- From: sqlite-users On Behalf Of Gerry Snyder Sent: Thursday, December 5, 2019

Re: [sqlite] sqlite sync over network

2019-12-05 Thread Reid Thompson
On Thu, 2019-12-05 at 12:54 +, George wrote: > [EXTERNAL SOURCE] > > > > Hi, > I need to sync sqlite tables over network between few devices. > Please help me with an opinion with what will be the best approach ? > thanks, > George > ___ >

Re: [sqlite] sqlite sync over network

2019-12-05 Thread George
We have an app already done in Qt on all terminals. Sqlite it's already used by this app. The only missing part it's our sync to have data on PC for reports and also on screen reports on terminals if operator will need to check.We need sqlite because help us to manage data on terminal and

Re: [sqlite] sqlite sync over network

2019-12-05 Thread Simon Slavin
Okay. Do you really need all of the terminals to have up-to-date data from all the terminals ? If not, it's a simple problem: each terminal sends data to the master, which puts all the incoming data into the same database. Terminals don't need a SQL dataase at all. They simply report

Re: [sqlite] sqlite sync over network

2019-12-05 Thread George
Hi Simon, I miss to talk about sync trigger. Will be great to be after post trigger. I mean we read a probe on terminal T1, save data and on post trigger also put a job for sync and leave it on other thread to do this. If some sync jobs fail will must to try again to sync or on timeout  stay in

Re: [sqlite] sqlite sync over network

2019-12-05 Thread George
Hi Simon, Thx for helping me. I'm trying to explain our setup next: Changes -> bidirectional. All terminals can save to db. Amount of collected data it's not big and frequency between readings will be minimum 2sec. When we push more readings. Data itself it's very small. Like reading

Re: [sqlite] sqlite sync over network

2019-12-05 Thread Simon Slavin
On 5 Dec 2019, at 12:54pm, George wrote: > I need to sync sqlite tables over network between few devices. > Please help me with an opinion with what will be the best approach ? Unfortunately this is a subject which has no simple solution. The things you have to do are not simple. To help us

[sqlite] sqlite sync over network

2019-12-05 Thread George
Hi, I need to sync sqlite tables over network between few devices. Please help me with an opinion with what will be the best approach ? thanks, George ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org