----- Original Message ----- From: "Christian Smith" <[EMAIL PROTECTED]> To: "Christian Smith" <sqlite-users@sqlite.org>; "Yuriy" <[EMAIL PROTECTED]> Sent: Monday, June 20, 2005 12:01 PM Subject: Re[2]: [sqlite] Sqlite low level and Speed.
> On Mon, 20 Jun 2005, Yuriy wrote: > > >CS> When creating testtable, specify val as unique, and specify what to do > >CS> with conflicts: > >CS> CREATE TABLE testtable(val TEXT UNIQUE ON CONFLICT REPLACE); > >CS> The conflict clauses are documented here: > >CS> http://www.sqlite.org/lang_conflict.html > >Try it for ~1,000,000 UNIQUE records very slow :( > >and me need allso count this UNIQUE records. now i try keep count in > >the memory. > > > What are you actually trying to do? And can you quantify "very slow" and > tell us what you actually expect or what would be acceptable? > > > > [snip sample] > > > Is this representitive of what you are trying to do? Are you storing IP > addresses, and you want to discard duplicates? Using the "on conflict" > resolution is probably your fastest course of action. if all he's doing is discarding duplicate strings, with no requirement for persistent storage, it is easily done with a primitive hash table implementation. could probably be done efficiently in less than a hundred lines of c, most of which could be adapted from some example code. -p