> It seems, that the problem is in sql. How to optimize table to have fast > selects?
Different sql queries require different things to be the fastest possible. There's no one magic pill for all. > INSERT INTO mgWords (id_norm,word,wform) VALUES (0,'aword','awform') > it clauses error. Which means you already have row with these id_norm, word and wform. What's the problem? Pavel On Wed, Oct 21, 2009 at 9:47 AM, Unabashed <wombat...@gmail.com> wrote: > > 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) > It seems, that the problem is in sql. How to optimize table to have fast > selects? > Second part of my trouble is in using unique values. When i'm trying to > change structure to > CREATE TABLE mgWords ( > id INTEGER PRIMARY KEY AUTOINCREMENT, > id_norm INTEGER, > word TEXT, > wform TEXT, > UNIQUE (id_norm,word,wform)) > and use > INSERT INTO mgWords (id_norm,word,wform) VALUES (0,'aword','awform') > it clauses error. > I'm not good in sql, so I'll be very glad to receive a professional answer. > Sorry, please, for my English - this is not my native language. Thank you fo > reading it :) > -- > View this message in context: > http://www.nabble.com/Slow-SELECTs-in-application-tp25992880p25992880.html > Sent from the SQLite mailing list archive at Nabble.com. > > _______________________________________________ > 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