Re: [sqlite] Bulk Insert in Sqlite3

2017-02-08 Thread Warren Young
On Feb 6, 2017, at 10:36 PM, Niti Agarwal wrote: > I read about SQLITE_MAX_SQL_LENGTH, If this is why you’re making many transactions, there’s no requirement that all of the SQL that’s part of a single transaction be in a single SQL string given to the DB. You can execute a bare “BEGIN TRANSA

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-07 Thread James K. Lowden
On Tue, 7 Feb 2017 14:42:13 +0800 Rowan Worth wrote: > Note that golang's sql transaction abstraction doesn't map perfectly > to sqlite. Golang does not allow any further operations on the Tx > following a call to Tx.Commit() or Tx.Rollback(). But in sqlite a > transaction remains open if COMMIT

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-06 Thread Rowan Worth
On 7 February 2017 at 15:11, Simon Slavin wrote: > > On 7 Feb 2017, at 6:56am, Niti Agarwal wrote: > > > Thanks for your reply. The length matters as I am appending 100 rows at a > > time in a sql statement. It is making very fast as compared to single sql > > insert in For loop. > > Copied the

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-06 Thread Simon Slavin
On 7 Feb 2017, at 6:56am, Niti Agarwal wrote: > Thanks for your reply. The length matters as I am appending 100 rows at a > time in a sql statement. It is making very fast as compared to single sql > insert in For loop. > Copied the code below for reference. Here the list size is 100 > Any bette

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-06 Thread Niti Agarwal
Thanks for your reply. The length matters as I am appending 100 rows at a time in a sql statement. It is making very fast as compared to single sql insert in For loop. Copied the code below for reference. Here the list size is 100 Any better way to do this? Like I read about *bind*...not sure how I

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-06 Thread Rowan Worth
Hi Niti, There's on need to build a giant SQL string; a transaction can span multiple statements. To bind in golang place a ? within your SQL query and provide the values as additional arguments to the Exec/Query function. eg, after using db.Begin() to create a transaction tx, err := db.Begin

Re: [sqlite] Bulk Insert in Sqlite3

2017-02-06 Thread Simon Slavin
On 7 Feb 2017, at 5:36am, Niti Agarwal wrote: > Need to insert close to 10 Million records to sqlite3 in around 30 mins. This number of records requires so much space the temporary data will not fit inside a cache. Consider using a counter so that the transaction is ended and a new one begun

[sqlite] Bulk Insert in Sqlite3

2017-02-06 Thread Niti Agarwal
Hi, We are using Sqlite3 with Golang to do bulk insert. Need to insert close to 10 Million records to sqlite3 in around 30 mins. Currently I am saving 100 Records under one transaction with below settings: PRAGMA synchronous = NORMAL; PRAGMA journal_mode = WAL; PRAGMA auto_vacuum

Re: [sqlite] Bulk Insert

2011-08-13 Thread Dominique Pellé
Stephan Beal wrote: > On Fri, Aug 12, 2011 at 1:51 PM, Sumit Gupta wrote: > >> I was try to to Read a Binary file in to the Sqlite Database using .NET. >> All >> NET to do bulk upload. I use that Dataset method to upload about 70,000 >> records in to SQL server and it take 10-15 sec, but in Sq

Re: [sqlite] Bulk Insert

2011-08-13 Thread Stephan Beal
On Fri, Aug 12, 2011 at 1:51 PM, Sumit Gupta wrote: > I was try to to Read a Binary file in to the Sqlite Database using .NET. > All > NET to do bulk upload. I use that Dataset method to upload about 70,000 > records in to SQL server and it take 10-15 sec, but in Sqlite it is still > taking mi

[sqlite] Bulk Insert

2011-08-13 Thread Sumit Gupta
Hello, I was try to to Read a Binary file in to the Sqlite Database using .NET. All is working great however my binary file has about 10M record and Insert query is only reading about 400-500 record per minute. This way it is going to take lot of time to read the File. I am trying to use Datase

Re: [sqlite] Bulk Insert

2011-08-12 Thread Sumit Gupta
To: sqlite-users@sqlite.org Subject: Re: [sqlite] Bulk Insert On 08/12/2011 14:25, Sumit Gupta wrote: > Hello, > > Thanks for your suggestion, yup the Speed with Transaction is increase > multifold. In 5 minute it read half the data. But wondering what different > the Transaction mak

Re: [sqlite] Bulk Insert

2011-08-12 Thread Black, Michael (IS)
orate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of Sumit Gupta [gamersu...@gmail.com] Sent: Friday, August 12, 2011 7:25 AM To: 'General Discussion of SQLite Database' Subject: EXT :Re: [sqlite] Bulk Insert Hello, Thanks for your suggestion, yup

Re: [sqlite] Bulk Insert

2011-08-12 Thread Julien Laffaye
On 08/12/2011 14:25, Sumit Gupta wrote: > Hello, > > Thanks for your suggestion, yup the Speed with Transaction is increase > multifold. In 5 minute it read half the data. But wondering what different > the Transaction make as compare to normal insert query ? Why is it faster > here. I didn't chang

Re: [sqlite] Bulk Insert

2011-08-12 Thread Sumit Gupta
Sent: 12 August 2011 17:48 To: General Discussion of SQLite Database Subject: Re: [sqlite] Bulk Insert It doesn't hold them in memory...they are still written to disk and just rolled back if you abort the transaction. Michael D. Black Senior Scientist NG Information Systems Advanced

Re: [sqlite] Bulk Insert

2011-08-12 Thread Black, Michael (IS)
qlite-users-boun...@sqlite.org] on behalf of Sumit Gupta [gamersu...@gmail.com] Sent: Friday, August 12, 2011 7:15 AM To: 'General Discussion of SQLite Database' Subject: EXT :Re: [sqlite] Bulk Insert But having Transaaction to hold 10M records in memory, well not sure if that help ? Sumit

Re: [sqlite] Bulk Insert

2011-08-12 Thread Jay A. Kreibich
On Fri, Aug 12, 2011 at 05:39:46PM +0530, Sumit Gupta scratched on the wall: > I was try to to Read a Binary file in to the Sqlite Database using .NET. All > is working great however my binary file has about 10M record and Insert > query is only reading about 400-500 record per minute. http://w

Re: [sqlite] Bulk Insert

2011-08-12 Thread Sumit Gupta
Subject: Re: [sqlite] Bulk Insert On Fri, Aug 12, 2011 at 2:09 PM, Sumit Gupta wrote: > query is only reading about 400-500 record per minute. This way it is going > If you are not currently using a transaction to wrap the whole import, add a transaction and the speed will improve a grea

Re: [sqlite] Bulk Insert

2011-08-12 Thread Stephan Beal
On Fri, Aug 12, 2011 at 2:09 PM, Sumit Gupta wrote: > query is only reading about 400-500 record per minute. This way it is going > If you are not currently using a transaction to wrap the whole import, add a transaction and the speed will improve a great deal. -- - stephan beal http://wan

[sqlite] Bulk Insert

2011-08-12 Thread Sumit Gupta
Hello, I was try to to Read a Binary file in to the Sqlite Database using .NET. All is working great however my binary file has about 10M record and Insert query is only reading about 400-500 record per minute. This way it is going to take lot of time to read the File. I am trying to use Datase

Re: [sqlite] Bulk insert performance

2011-05-29 Thread Joe D
On 2011-05-29 06:14, Kees Nuyt wrote: > On Sun, 29 May 2011 10:35:51 +1000, "Greg Keogh" > wrote: > >> I'm utterly gobsmacked by the poor performance of the >> inserts without a transaction around them. > > It's a FAQ, > http://www.sqlite.org/faq.html#q19 > explains the reasons quite clearly. Also

Re: [sqlite] Bulk insert performance

2011-05-29 Thread Kees Nuyt
On Sun, 29 May 2011 10:35:51 +1000, "Greg Keogh" wrote: > I'm utterly gobsmacked by the poor performance of the > inserts without a transaction around them. It's a FAQ, http://www.sqlite.org/faq.html#q19 explains the reasons quite clearly. -- ( Kees Nuyt ) c[_] ___

[sqlite] Bulk insert performance

2011-05-29 Thread Greg Keogh
Hello team, this isn't really a bug report, it's just a heads-up about a trap for new players. I've just started evaluating the SQLite 1.0.66.0 ADO.NET provider, and I'm most impressed by the whole experience. For your possible interest I have pasted below a copy of a post I just made into the Aust

Re: [sqlite] Bulk insert

2008-03-09 Thread Vincent Vega
9, 2008 12:44 PM To: sqlite-users@sqlite.org Subject: [sqlite] Bulk insert Hi all , I need to insert 500 records (each record has 12 bytes) to a table and it takes me approximately 2 seconds. Is there a way to improve my code so it can do it faster? Thanks in advance, Marco. Here is my code: qu

Re: [sqlite] Bulk insert

2008-03-09 Thread Adler, Eliedaat
: [sqlite] Bulk insert Hi all , I need to insert 500 records (each record has 12 bytes) to a table and it takes me approximately 2 seconds. Is there a way to improve my code so it can do it faster? Thanks in advance, Marco. Here is my code: query = sqlite3_mprintf("Insert

[sqlite] Bulk insert

2008-03-09 Thread Vincent Vega
Hi all , I need to insert 500 records (each record has 12 bytes) to a table and it takes me approximately 2 seconds. Is there a way to improve my code so it can do it faster? Thanks in advance, Marco. Here is my code: query = sqlite3_mprintf("Insert into Inventory (Tag) va

RE: [sqlite] Bulk insert or saving in memory database to file?

2004-05-07 Thread Ionut Filip
Filip -Original Message- From: Shawn Anderson [mailto:[EMAIL PROTECTED] Sent: Friday, May 07, 2004 6:13 PM To: [EMAIL PROTECTED] Subject: [sqlite] Bulk insert or saving in memory database to file? Howdy, I was wondering if anyone had any ideas on either of these options? Basically I have abou

RE: [sqlite] Bulk insert or saving in memory database to file?

2004-05-07 Thread Griggs, Donald
> sqlite yourbigdatabase > COPY yourbigdatabase.yourbigtable FROM yourbigdatafile Shawn, To follow-up on Puneet's answer: -- You can choose your delimiter. E.g. if you had comma-delimited data: COPY mytable FROM 'myfile.csv' USING DELIMITERS ','; Remember the nee

Re: [sqlite] Bulk insert or saving in memory database to file?

2004-05-07 Thread Puneet Kishor
Shawn Anderson wrote: Howdy, I was wondering if anyone had any ideas on either of these options? Basically I have about 300 mb of data that I want to insert in a database using SQLite, and I am trying to find the most efficient way of doing it. My thoughts are either to find a fast bulk insert met

[sqlite] Bulk insert or saving in memory database to file?

2004-05-07 Thread Shawn Anderson
Howdy, I was wondering if anyone had any ideas on either of these options? Basically I have about 300 mb of data that I want to insert in a database using SQLite, and I am trying to find the most efficient way of doing it. My thoughts are either to find a fast bulk insert method, or maybe using an