Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-11 Thread Lev
On Sat, 10 Sep 2016 13:31:51 +0100 Simon Slavin wrote: > You do it after opening a connection to the database. Probably the > first thing you do after sqlite3_open(). Thanks! -- 73 de HA5OGL Op.: Levente ___ sqlite-users mailing list sqlite-users@ma

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-10 Thread Simon Slavin
On 10 Sep 2016, at 11:57am, Lev wrote: >> > > Is it enough to set this once as the connection created? Or shall I set this > every time a do sqlite3_step()? You do it after opening a connection to the database. Probably the first thing

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-10 Thread Lev
On Fri, 9 Sep 2016 14:51:51 +0100 Simon Slavin wrote: > Set a timeout of five minutes when you open your SQLite connections > using one of the following: > > Is it enough to set this once as the connection created? Or shall I set this eve

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Keith Medcalf
] > On Behalf Of Bhavesh Patel > Sent: Friday, 9 September, 2016 06:50 > To: SQLite mailing list > Subject: [sqlite] sqlite - Delete large table in sqlite > > I have a 4GB SQLite database (currently using SQLCipher for encryption). I > have created a physical table in the SQLite

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Quan Yong Zhai
org> Sent: 2016年9月9日 23:33 To: SQLite mailing list<mailto:sqlite-users@mailinglists.sqlite.org> Subject: Re: [sqlite] sqlite - Delete large table in sqlite On 9 Sep 2016, at 6:14pm, Венцислав Русев wrote: > I don't know if this will work for you, but can't you delete 1000

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Scott Hess
Do you have auto_vacuum turned on? It may be that the cost isn't actually in deleting the table, it may be that the cost is rearranging the rest of the file to fill the gaps left by deleting the table. In that case you could turn off auto_vacuum, or you could use incremental vacuum to smooth out

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Carlos
maybe rename and recreate the database with "insert from" the remaining tables would be faster, and give the benefit of a vacuum also? On 09/09/2016 13:14, Венцислав Русев wrote: On 09/09/2016 12:49 PM, Bhavesh Patel wrote: I have a 4GB SQLite database (currently using SQLCipher for encrypt

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Simon Slavin
On 9 Sep 2016, at 6:14pm, Венцислав Русев wrote: > I don't know if this will work for you, but can't you delete 1000 rows then > another 1000 ... until the table is empty. If you do do that, each 1000 rows should be deleted inside a transaction. So BEGIN DELETE FROM myTable WHERE ... END Bu

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Венцислав Русев
On 09/09/2016 12:49 PM, Bhavesh Patel wrote: I have a 4GB SQLite database (currently using SQLCipher for encryption). I have created a physical table in the SQLite DB which has approx 20 rows x 183 columns. When I am trying to delete the table. Sqlite is taking up a lot of time to delete

Re: [sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Simon Slavin
On 9 Sep 2016, at 1:49pm, Bhavesh Patel wrote: > during the process of delete/drop is running, if I try to connect I randomly > get database lock error. Set a timeout of five minutes when you open your SQLite connections using one of the following:

[sqlite] sqlite - Delete large table in sqlite

2016-09-09 Thread Bhavesh Patel
I have a 4GB SQLite database (currently using SQLCipher for encryption). I have created a physical table in the SQLite DB which has approx 20 rows x 183 columns. When I am trying to delete the table. Sqlite is taking up a lot of time to delete the huge table. I tried drop table and also del