[sqlite] Manifest Typing question

2005-06-20 Thread Tito Ciuro

Hello,

When I add text to the database, it's getting truncated because  
SQLite is converting it to a number. For example, I enter "9.0", but  
SQLite stores it as "9".


Is there a way to force the value to be inserted as string?

Thanks,

-- Tito


Re: Re: Re: [sqlite] Poor performance searching from multiple DBs

2005-06-20 Thread chinasky65



>It's not the first field in the index, so I don't think it >will use it

>for searching on "WHERE field5 = 'xxx'  ".



>Try adding an index on field5 only



> CREATE UNIQUE INDEX main_indexf5 ON main (field5);





>I don't see any problem.



Thanks Jay.

You are right.

The query in a PC change from 34 Secs to 0,036 secs.

Nice.



Thanks for your suggestions.

China.



---
Scegli il tuo dominio preferito e attiva la tua email! Da oggi
l'eMail di superEva e' ancora piu' veloce e ricca di funzioni!
http://webmail.supereva.it/new/
---



[sqlite] No video from OSCON

2005-06-20 Thread Randy Ray
I just heard back from my contact, and they do not video the tutorials.
Generally, the tutorial teachers don't want this anyway, as they sell the same
tutorial to other companies (and a cheap DVD would undermine that). I suppose
that, in theory, Dr. Hipp could arrange to have his own person there recording
the presentation, but he might want to check with the conference organizers 
first.

Randy
-- 
[EMAIL PROTECTED]  http://www.rjray.org http://www.svsm.org

We will never have true civilization until we have learned to recognize the
rights of others.-- Will Rogers


Re: [sqlite] Write performance

2005-06-20 Thread Christian Smith
On Fri, 17 Jun 2005, Sean Heber wrote:

>>> SQLite write (insert) performance doesn't seem very good to me so I'm
>>> trying to find ways to improve it in my application.  I had this idea
>>> so I figured I'd run it past you folks who likely better know how the
>>> db works under the hood.
>>>
>>
>> did you wrap your inserts in a transaction?
>
>I don't think I can do that because the inserts come in at random
>intervals as they are generated by outside influences.  I'm not just
>doing an import of existing data as the data is created on the fly by
>factors somewhat outside of my control.  I tried to make an in-memory
>temporary table and insert into that and periodically start a
>transaction with an "insert into real_table select from memory_table"
>thing in bulk, but that didn't seem to make a significant
>difference.  Perhaps I've got something else wrong.


If data is coming in slowly, then doing a transaction per data object is
no problem.

If data is coming in fast, then handling multiple data objects per
transaction is a must for efficiency.

Therefore, why not do both? Poll data objects to be processed, and insert
into the current transaction until no more data is available for some
threshold is reached:

process() {
while(1) {
int datacount = 0;
wait for data;
while(data available && datacount < threshold) {
get data from source;
if (0==datacount) {
begin transaction
}
insert data to db;
datacount++;
}
commit transaction;
}
}

In this case, the consumer will batch up to threshold data inserts,
increasing efficiency. If the producer stops producing data, the consumer
will find no more data and exit it's inner loop. Threshold prevents the
transaction and latency growing indefinitely.

For tuning, you could even make threshold dynamic. Start small, and
increase it's value to some maximum if the current threshold is exceeded.

>
>Thanks for the suggestion.
>
>l8r
>Sean
>
>

-- 
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \


Re: [sqlite] Write performance

2005-06-20 Thread Eric Scouten

Sean Heber wrote:

I've been inserting data into a table with a non-integer primary
key.  The data does not come in in an ordered fashion.  My thought is
that perhaps performance suffers because it needs to rewrite huge
chunks of the data file in order to slot the new data into its
correct position within the file based on the sorting of the primary
key.


That makes sense, okay.  Perhaps my problem is that my data is too  
big.  Is a page around 1k?  I often insert blob data in the 64k  range.  
Perhaps that is my problem.


My experience is that for chunks of data that are above something like 
20K, you're better off (performance-wise) writing to separate, 
individual files than using SQLite blobs.


-Eric


Re: Re: [sqlite] Poor performance searching from multiple DBs

2005-06-20 Thread Jay Sprenkle
> >> I have to search for field5 in some DB files (30 or more >>for a total of 
> >> 50 GB of   space and 150 M of records ).
> 
> >> select * from main where field5= "AABBCCDD";
> 
> 
> 
> > Did you put an index on field5?
> 
> Yes I use:
> 
> CREATE UNIQUE INDEX main_index ON main (field2,field5,field7);

It's not the first field in the index, so I don't think it will use it
for searching on "WHERE field5 = 'xxx'  ".

Try adding an index on field5 only

 CREATE UNIQUE INDEX main_indexf5 ON main (field5);

> 
> 
> 
> Is a quite complex index used for eliminating duplicates, is it OK?

I don't see any problem.


Re: Re: [sqlite] Poor performance searching from multiple DBs

2005-06-20 Thread chinasky65





>> I have to search for field5 in some DB files (30 or more >>for a total of 50 
>> GB of   space and 150 M of records ).

>> select * from main where field5= "AABBCCDD";



> Did you put an index on field5?

Yes I use:

CREATE UNIQUE INDEX main_index ON main (field2,field5,field7);



Is a quite complex index used for eliminating duplicates, is it OK?



China.

---
Scegli il tuo dominio preferito e attiva la tua email! Da oggi
l'eMail di superEva e' ancora piu' veloce e ricca di funzioni!
http://webmail.supereva.it/new/
---



Re: Re[4]: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Puneet Kishor


On Jun 20, 2005, at 11:24 AM, Yuriy wrote:

CS> What are you actually trying to do? And can you quantify "very 
slow" and

CS> tell us what you actually expect or what would be acceptable?
100,000 oll ok 7 seconds
1,000,000 software halt :(

CS> Is this representitive of what you are trying to do? Are you 
storing IP
CS> addresses, and you want to discard duplicates? Using the "on 
conflict"

CS> resolution is probably your fastest course of action.
I write log analyzer and want to use sqlite as database.

All Operations in my software grouping big list strings.
and need the fastest speed.
if use "group by" it is slow :(

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.


or, a couple of three lines of Perl.


Yes need disk-based hash or btree. But SQLite in the low level it
Disk-Based Btree.



Pre-process the log file, creating a hash with the unique field as the 
key. Then, loop over the hash and insert it in your db.


If memory is a constraint, don't bother even creating a hash. Loop over 
the log file, create an array, sort the array, remove the duplicates, 
then insert it in the db, making sure that you have AutoCommit off and 
commits every 10k or 100k records.


Should be done in a few seconds. To give you an idea, I once de-duped a 
file with 320 million rows of duplicate email addresses in about 120 
seconds on an ancient, creaking iBook. A million records should be a 
piece of cake.



--
Puneet Kishor



Re[4]: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Yuriy
CS> What are you actually trying to do? And can you quantify "very slow" and
CS> tell us what you actually expect or what would be acceptable?
100,000 oll ok 7 seconds
1,000,000 software halt :(

CS> Is this representitive of what you are trying to do? Are you storing IP
CS> addresses, and you want to discard duplicates? Using the "on conflict"
CS> resolution is probably your fastest course of action.
I write log analyzer and want to use sqlite as database.

All Operations in my software grouping big list strings.
and need the fastest speed.
if use "group by" it is slow :(

>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.
Yes need disk-based hash or btree. But SQLite in the low level it
Disk-Based Btree.


-- 
Best regards,
 Yuriymailto:[EMAIL PROTECTED]



Re: Re[2]: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Paul G

- Original Message - 
From: "Christian Smith" <[EMAIL PROTECTED]>
To: "Christian Smith" ; "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



Re[2]: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Christian Smith
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.


>
>
>CS> If you want access to such functions, you must compile your own library
>CS> exporting the functions on Windows, and fix problems in the future if this
>CS> API changes at all.
>
>Can do this on Visual C++
>May be have examples? Or steps?


I don't work with VC, but I presume you can just create a new DLL project
(or workspace?) and add the SQLite source files, add your required build
flags, and create a DLL def file to export the various Btree functions you
require.


Christian


-- 
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \


Re: [sqlite] assert during exec of sql statment

2005-06-20 Thread D. Richard Hipp
On Mon, 2005-06-20 at 15:03 +0300, Amir Hadar wrote:
> Hi
> 
> I encountered an assert in function moveToRoot in file btree.c.
> 

Not much to go on.  Can you tell me what you were doing
or how to reproduce the problem?
-- 
D. Richard Hipp <[EMAIL PROTECTED]>



Re: [sqlite] errors compiling with MS VC++ 6.0

2005-06-20 Thread Dennis Cote

Robert G. Ristroph wrote:


   I am building sqlite 3.2.2 on windows with MS VC++ 6.0.  I am doing this
because I believe I need the .lib file to use the .dll with my code.




Hi Robert,

You don't need to build SQLite in VC++ to generate the .lib file. VC++ 
includes a utility program called lib that is used to make a suitable 
lib file for a dll. All you need to do is feed the sqlite3.def file 
included in the SQLite source to this utility and it will generate a lib 
file for you. You then add the lib file to your project, and it will 
load and use the API functions in sqlite3.dll. A sample lib command line 
is given below.


 lib /machine:i386 /def:sqlite3.def

HTH
Dennis Cote


Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Jay Sprenkle
Yes. Sorry, haven't had my morning caffeine yet. ;)

On 6/20/05, Will Leshner <[EMAIL PROTECTED]> wrote:
> 
> On Jun 20, 2005, at 7:42 AM, Jay Sprenkle wrote:
> 
> > for i:=1 to 1000 do
> > begin tran
> > insert or on conflict fail into testtable(val) values(StringN);
> > commit
> > end for
> >
> 
> 
> Shouldn't the transaction wrap the loop?
> 


-- 
---
You a Gamer? If you're near Kansas City:
Conquest 36
https://events.reddawn.net

The Castles of Dereth Calendar: a tour of the art and architecture of
Asheron's Call
http://www.lulu.com/content/77264


Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Will Leshner


On Jun 20, 2005, at 7:42 AM, Jay Sprenkle wrote:


for i:=1 to 1000 do
begin tran
insert or on conflict fail into testtable(val) values(StringN);
commit
end for




Shouldn't the transaction wrap the loop?


Re: [sqlite] Query on multiple tables

2005-06-20 Thread Dennis Cote

Martin Gagnon wrote:


Hi all,
Using sqlite3 on QNX 6.3.0.
I need to do a select query on 3 tables by binding them by their ID's.
Something like:
Select tbl1.ID, tbl1.fld1, tbl1.fld2 /*(15 fields total, all from
tbl1)*/ from tbl1, tbl2, tbl3, where tbl1.ID=4 AND tbl1.ID=tbl2.ParentID
AND tbl2.ID=tbl3.ParentID
This returns the expected row instantly but the sqlite3 process takes
more that 10 seconds to give back a prompt, taking all the CPU time.
Is there a way to accomplish this task better?
Thank you,
Martin Gagnon

 


Martin,

Pardon me if I missed something, but if your query only returns fields 
from table tbl1 (as it says in your comment), why do you need to join 
with the other tables? Your query doesn't reference fields from the 
other tables in where clauses that might restrict the rows that are 
returned, it only gives the join conditions. From what you have said, 
this should equivalent to your query;


Select tbl1.ID, tbl1.fld1, tbl1.fld2 /*(15 fields total, all from
tbl1)*/ from tbl1 where tbl1.ID=4 


Dennis Cote




Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Jay Sprenkle
On 6/20/05, Yuriy <[EMAIL PROTECTED]> wrote:

> 1. Example of the decision
> 
> CREATE TABLE testtable (val text)
> CREATE INDEX index_val ON [testtable]([val]);
> PRAGMA synchronous = OFF;
> 
> for i:=1 to 1000 do
> begin
> select * from testable where  val=StringN
> if val NOT Exist  insert into testtable
> end
> 
> Very Slow.

for i:=1 to 1000 do
begin tran
insert or on conflict fail into testtable(val) values(StringN);
commit
end for


[sqlite] assert during exec of sql statment

2005-06-20 Thread Amir Hadar
Hi

I encountered an assert in function moveToRoot in file btree.c.

The assert is in the following code:

 

static int moveToRoot(BtCursor *pCur){

  MemPage *pRoot;

  int rc;

  Btree *pBt = pCur->pBt;

 

  rc = getAndInitPage(pBt, pCur->pgnoRoot, , 0);

  if( rc ){

pCur->isValid = 0;

return rc;

  }

  releasePage(pCur->pPage);

  pageIntegrity(pRoot);

  pCur->pPage = pRoot;

  pCur->idx = 0;

  pCur->info.nSize = 0;

  if( pRoot->nCell==0 && !pRoot->leaf ){

Pgno subpage;

assert( pRoot->pgno==1 ); //  this
assert goes off

subpage = get4byte(>aData[pRoot->hdrOffset+8]);

assert( subpage>0 );

pCur->isValid = 1;

rc = moveToChild(pCur, subpage);

  }

  pCur->isValid = pCur->pPage->nCell>0;

  return rc;

}

 

The attached file shows the values of pRoot variable. You can see that
its page number is 11.

What could go wrong, please help me solve this problem.

 

Here are some variable of pRoot:

pRoot->isInit = 1

pRoot->idxShift = 0

pRoot->nOverflow = 0

pRoot->intKey = 0

pRoot->leaf = 0

pRoot->zeroData = 0

pRoot->leafData = 0

pRoot->hasData = 1

pRoot->hdrOffset = 0

pRoot->childPtrSize = 4

pRoot->maxLocal = 230

pRoot->minLocal = 103

pRoot->cellOffset = 12

pRoot->idxParent = 0

pRoot->nFree = 65524

pRoot->nCell = 0

pRoot->pgno = 11

 

Thanks,

Amir Hadar

IXI Platforms / Componentization Team

 

tel: +972.9.7476668

fax: +972.9.7476600

mobile: +972.52.8550201

email: [EMAIL PROTECTED]  

IXI Mobile Inc.

 


**

This email and any attachments thereto contain private, confidential,
and privileged material. Any use, review, copying, or disclosure of this
email (or any attachments thereto) by any party other than the intended
recipient is strictly prohibited. If you are not the intended recipient,
please contact the sender immediately and permanently delete the
original and any copies of this email and any attachments thereto.

 



[sqlite] Quick news on the Perl-bindings front

2005-06-20 Thread Randy J. Ray
I just sent a patch to the maintainer of the DBD::SQLite package, that lets it
build against an installed version of the library. The current package carries
a copy of the code with it, and builds it locally. With this patch, you can
update your base sqlite installation and the Perl driver will stay in sync.

Not sure about the maintainer's schedule, but I imagine we'll see a release in
the next few days.

Randy
-- 
"""
Randy J. RayCampbell, CAhttp://www.rjray.org   [EMAIL PROTECTED]

Silicon Valley Scale Modelers: http://www.svsm.org


Re: [sqlite] Re: - Re: [sqlite] Training opportunity: The Inner Workings Of SQLite

2005-06-20 Thread Ben Clewett

Dear Richard,

I have forwarded your email to a friend in my university (Open 
University) who often arrange conferences and tutorials.  I am sure due 
to the popularity and respect UK programmers have for SQLite, something 
may be possible.


Regards, Ben Clewett.


D. Richard Hipp wrote:

On Mon, 2005-06-20 at 08:23 +0100, Ben Clewett wrote:

May I ask if this tutorial will be held in the UK?  If not I'll second 
the requests for DVD or written transcripts.





The tutorial has not been proposed for any european
conferences.  Though, if you can suggest one and make
a case that there is sufficient interest, I'm sure
something could be worked out.





Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Christian Smith
On Mon, 20 Jun 2005, Yuriy wrote:

>Hello sqlite-users,
>
>Sqlite low level and Speed.
>
>Sorry for my bad English.
>
>I try use  Sqlite  for  Operation FAST grouping  strings (delete duplicates)
>
>I have input array of strings
>
>String1
>String2
>String3
>String1
>String2
>???
>StringN
>
>
>Need delete dublicates.
>
>Output database
>String1
>String2
>String3
>??..
>StringN
>
>1. Example of the decision
>
>CREATE TABLE testtable (val text)
>CREATE INDEX index_val ON [testtable]([val]);

When creating testtable, specify val as unique, and specify what to do
with conflicts:
CREATE TABLE testtable(val TEXT UNIQUE ON CONFLICT REPLACE);

The conflict clauses are documented here:
http://www.sqlite.org/lang_conflict.html

Note, the following does not work as expected (as I expected, at least!)
CREATE TABLE testtable (val text);
CREATE INDEX index_val ON testtable(val) ON CONFLICT REPLACE;

The conflict clause appears to be ignored.


>PRAGMA synchronous = OFF;
>
>for i:=1 to 1000 do
>begin
>select * from testable where  val=StringN
>if val NOT Exist  insert into testtable
>end
>
>Very Slow.
>
>2. Example of the decision
>
>
>CREATE TABLE testtable (val text,hashval integer)
>CREATE INDEX index_hashval ON [testtable]([ hashval]);
>PRAGMA synchronous = OFF;
>
>for i:=1 to 1000 do
>begin
>select * from testable where  hashval=hash(StringN)and(val= StringN)
>if val NOT Exist  insert into testtable
>end
>
>Very Slow.
>
>
>3. Example of the decision
>
>I find good example for SQLite Low level functions SQlite VS BDB.
>
>http://rganesan.blogspot.com/
>
>But this example use such functions as
>
>sqlite3BtreeOpen
>sqlite3BtreeInsert
>sqlite3BtreeCursor
>
>I Use Windows and Delphi. In the SQlite3.dll no import this functions.
>
>Please Help me. May be need recompile sql I Have Visual C++ and C++Builder
>If need recompile as make it is on Windows Platform?


The Btree functions are internal to SQLite and subject to change without
notice. Hence they are not exported.

If you want access to such functions, you must compile your own library
exporting the functions on Windows, and fix problems in the future if this
API changes at all.


>
>May be present other decision this problem? Need more speed for grouping
>big arrays of strings


Group them by what criteria? How about just using an aggregate select or
group by?


>
>Thanks you.
>

Christian


-- 
/"\
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
 X   - AGAINST MS ATTACHMENTS
/ \


Re: [sqlite] Re: - Re: [sqlite] Training opportunity: The Inner Workings Of SQLite

2005-06-20 Thread D. Richard Hipp
On Mon, 2005-06-20 at 08:23 +0100, Ben Clewett wrote:
> May I ask if this tutorial will be held in the UK?  If not I'll second 
> the requests for DVD or written transcripts.
> 

The tutorial has not been proposed for any european
conferences.  Though, if you can suggest one and make
a case that there is sufficient interest, I'm sure
something could be worked out.

-- 
D. Richard Hipp <[EMAIL PROTECTED]>



Re[2]: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Yuriy
BV> use transactions, speeds up a lot
Sorry transaction i also use speed low :(

begin
c:=0;
for i:=1 to 1000 do
begin
select * from testable where  val=StringN
if val NOT Exist  insert into testtable

 inc(c);
  if c=1 then
  begin
  Commit;
  Begin;
  c:=0;
  end;

end

commit

-- 
Best regards,
 Yuriymailto:[EMAIL PROTECTED]



Re: [sqlite] Sqlite low level and Speed.

2005-06-20 Thread Bert Verhees
use transactions, speeds up a lot

Op maandag 20 juni 2005 11:35, schreef Yuriy:
> Hello sqlite-users,
>
> Sqlite low level and Speed.
>
> Sorry for my bad English.
>
> I try use  Sqlite  for  Operation FAST grouping  strings (delete
> duplicates)
>
> I have input array of strings
>
> String1
> String2
> String3
> String1
> String2
> ………
> StringN
>
>
> Need delete dublicates.
>
> Output database
> String1
> String2
> String3
> ……..
> StringN
>
> 1. Example of the decision
>
> CREATE TABLE testtable (val text)
> CREATE INDEX index_val ON [testtable]([val]);
> PRAGMA synchronous = OFF;
>
> for i:=1 to 1000 do
> begin
> select * from testable where  val=StringN
> if val NOT Exist  insert into testtable
> end
>
> Very Slow.
>
> 2. Example of the decision
>
>
> CREATE TABLE testtable (val text,hashval integer)
> CREATE INDEX index_hashval ON [testtable]([ hashval]);
> PRAGMA synchronous = OFF;
>
> for i:=1 to 1000 do
> begin
> select * from testable where  hashval=hash(StringN)and(val= StringN)
> if val NOT Exist  insert into testtable
> end
>
> Very Slow.
>
>
> 3. Example of the decision
>
> I find good example for SQLite Low level functions SQlite VS BDB.
>
> http://rganesan.blogspot.com/
>
> But this example use such functions as
>
> sqlite3BtreeOpen
> sqlite3BtreeInsert
> sqlite3BtreeCursor
>
> I Use Windows and Delphi. In the SQlite3.dll no import this functions.
>
> Please Help me. May be need recompile sql I Have Visual C++ and C++Builder
> If need recompile as make it is on Windows Platform?
>
> May be present other decision this problem? Need more speed for grouping
> big arrays of strings
>
> Thanks you.

-- 
Met vriendelijke groet
Bert Verhees
ROSA Software


[sqlite] Sqlite low level and Speed.

2005-06-20 Thread Yuriy
Hello sqlite-users,

Sqlite low level and Speed.

Sorry for my bad English.

I try use  Sqlite  for  Operation FAST grouping  strings (delete duplicates)

I have input array of strings

String1
String2
String3
String1
String2
………
StringN


Need delete dublicates.

Output database
String1 
String2
String3
……..
StringN

1. Example of the decision

CREATE TABLE testtable (val text)
CREATE INDEX index_val ON [testtable]([val]);
PRAGMA synchronous = OFF;

for i:=1 to 1000 do
begin
select * from testable where  val=StringN
if val NOT Exist  insert into testtable
end

Very Slow. 

2. Example of the decision


CREATE TABLE testtable (val text,hashval integer)
CREATE INDEX index_hashval ON [testtable]([ hashval]);
PRAGMA synchronous = OFF;

for i:=1 to 1000 do
begin
select * from testable where  hashval=hash(StringN)and(val= StringN) 
if val NOT Exist  insert into testtable
end

Very Slow. 


3. Example of the decision

I find good example for SQLite Low level functions SQlite VS BDB.

http://rganesan.blogspot.com/

But this example use such functions as

sqlite3BtreeOpen
sqlite3BtreeInsert
sqlite3BtreeCursor

I Use Windows and Delphi. In the SQlite3.dll no import this functions.

Please Help me. May be need recompile sql I Have Visual C++ and C++Builder
If need recompile as make it is on Windows Platform?

May be present other decision this problem? Need more speed for grouping big 
arrays of strings

Thanks you.
  

-- 
Best regards,
 Yuriy  mailto:[EMAIL PROTECTED]



Re: [sqlite] Reading German Umlauts correct

2005-06-20 Thread Ralf Junker
SQLite stores text as UTF-8 - this is the default and it can be changed to 
UTF16, but you would probably encounter similar problems.

"ü" is the UTF-8 representation of "ü" - to retrieve and display the German 
Umlaut you must decode the UTF-8 encoded text to its Unicode representation. 
For more on Unicode and UTF-8, see http://www.unicode.org.

I have written a SQLite database explorer named SQLiteSpy which displays UTF-8 
encoded SQLite databases including German Umlauts. SQLiteSpy is available for 
free from

  http://www.yunqa.de/delphi/sqlitespy/

You can also uses SQLiteSpy to enter Umlauts as SQL and they will be 
automatically encoded as appropriate (UTF-8 or UTF-16) and stored in your 
database.

Regards,

Ralf

>I'm reading Information from a SQLite database. But this Information
>contains German umlauts like ä, ö, ü. When I get these Information back in
>my Programm, these umlauts are unreadable. The ü for example is ü. The
>umlauts are stored in the Database correctly.
> 
>Can somebody tell me, what I have to do, that the umlauts are displayes
>correctly exept a string manipulation after data-reading?



[sqlite] "database full" errors

2005-06-20 Thread Cory Nelson
what would cause this error?

I have a few users reporting it, all with different database file
sizes.  is there a limit on row counts in 3.x ?

-- 
Cory Nelson
http://www.int64.org


Re: [sqlite] Re: - Re: [sqlite] Training opportunity: The Inner Workings Of SQLite

2005-06-20 Thread Ben Clewett
May I ask if this tutorial will be held in the UK?  If not I'll second 
the requests for DVD or written transcripts.


Kind regards,

Ben Clewett.

D. Richard Hipp wrote:

On Mon, 2005-06-20 at 10:34 +1000, [EMAIL PROTECTED] wrote:


I too would be happy to pay for DVDs if they were to be made available.
Tyranny of distance prevents me from attending (Sydney, Australia based).




The same talk has been proposed for AUUG in Sydney
in October.  It has not yet been accepted, though.