On Wed, Apr 28, 2010 at 4:08 PM, Ian Hardingham <[email protected]> wrote:
> Hey guys - this is my first post here, apologies if I violate any etiquette.
>
> I have a table I create with:
>
> CREATE TABLE IF NOT EXISTS globalRankingTable (id INTEGER PRIMARY KEY
> AUTOINCREMENT, name TEXT NOT NULL UNIQUE, ranking TEXT, score REAL,
> record TEXT);
>
> I run a loop from a scripting language which hooks into SQLite, which
> basically calls this INSERT statement 1000 times:
>
> INSERT INTO globalRankingTable (name, ranking, score, record) VALUES
> ('?','?',?,'?')"
>
> This takes a good 23 seconds (and my machine isn't exactly slow).  I am
> doing a lot of SQLite stuff in my application and everything else seems
> to be running fine.

use transactions... start with BEGIN, then INSERT your data, then COMMIT.


>
> Here's some further information:
>
> 1.  I have narrowed it down that the time is being taken in the call to
> sqlite3_exec
> 2.  The length of the strings is not particularly high - like 10 chars
> generally.
>
> I'm pretty noob at SQLite and am completely stumped - any advice at all
> would be much appreciated
>
>
> Ian
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to