It isn't just speed. That is probably the cause of the insert error. A
PRIMARY KEY column is implied UNIQUE and NOT NULL but the insert doesn't
specify a value for id. Since it isn't aliased to rowid (and therefore
doesn't autoincrement) it would raise an error.

John

-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Keith Roberts
Sent: Wednesday, October 21, 2009 12:36 PM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Slow SELECTs in application

On Wed, 21 Oct 2009, Unabashed wrote:

> To: sqlite-users@sqlite.org
> From: Unabashed <wombat...@gmail.com>
> Subject: [sqlite]  Slow SELECTs in application
> 
>
> Hello!
> I'm using SQLite as DB in my application. My problem consists of two
> aspects. First , it works great, but on large data SELECTs are very
slow
> (10-20s!). Queries are in one transaction. My table structure is:
> CREATE TABLE mgWords (
>  id INTEGER PRIMARY KEY AUTOINCREMENT,
>  id_norm INTEGER,
>  word TEXT,
>  wform TEXT)

You could try removing the AUTOINCREMENT constraint to 
speed things up a little.

All you need is:

id INTEGER PRIMARY KEY,

That will allow you to reference the rowid using the 'id' 
identifyer. They both referer to the same thing.

Please see: http://www.sqlite.org/autoinc.html

for all the details.

Kind Regards,

Keith Roberts

-----------------------------------------------------------------
Websites:
http://www.php-debuggers.net
http://www.karsites.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------------
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to