RE: [sqlite] .import problems

2006-03-20 Thread Balthasar Indermuehle
Duuh. The trailing ";" needs a space, otherwise the .import command thinks
";" is part of the table name. Probably not a valid character for a table
name anyway, so I guess that goes under the category "unwanted features".

Cheers


Balthasar T. Indermuehle
UNSW
Antarctic Astrophysics Group

 

> -----Original Message-----
> From: Balthasar Indermuehle [mailto:[EMAIL PROTECTED] 
> Sent: Dienstag, 21. März 2006 18:11
> To: sqlite-users@sqlite.org
> Subject: [sqlite] .import problems
> 
> Hi all,
>  
> I'm trying to import a rather large file with the .import 
> command into a version 3 sqlite DB file. I have created the 
> table named data, all fields are numeric, I type ".import 
> data.csv data" and I get the sqlite3 error
> "Error: No such table: data;"
>  
> Any ideas anyone?
>  
> thanks
>  
> 
> Balthasar T. Indermuehle
> UNSW
> Antarctic Astrophysics Group
> 
>  
> 



[sqlite] .import problems

2006-03-20 Thread Balthasar Indermuehle
Hi all,
 
I'm trying to import a rather large file with the .import command into a
version 3 sqlite DB file. I have created the table named data, all fields
are numeric, I type ".import data.csv data" and I get the sqlite3 error
"Error: No such table: data;"
 
Any ideas anyone?
 
thanks
 

Balthasar T. Indermuehle
UNSW
Antarctic Astrophysics Group

 


RE: [sqlite] sqliteOsEnterMutex() and sqliteOsLeaveMutex()

2004-07-15 Thread Balthasar Indermuehle
Somehow I think there are not a lot of Win32 programmers on this list...

Threads are very safe to use, and in many instances the only reasonable
technology to use. A web server without threads? You're not going to
serve many customers... And best of all, the OS takes care of spreading
the load on multiple processors or, if you have a later generation
pentium processor, makes use of the hyperthreading technology.

The only caveat: You have to understand how they work. In that sense
you're right when you say it's dangerous to use them if you don't know
what you're doing. But that applies to a microwave as well, no?

Balthasar Indermuehle
Inside Systems GmbH
http://www.inside.net

"The wireless music box has no imaginable commercial value. Who would
pay for a message sent to nobody in particular?" 
David Sarnoff's associates in response to his urging for investment in
the radio in the 1920s.  

> -Original Message-
> From: CARIOTOGLOU MIKE [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 15, 2004 18:00
> To: [EMAIL PROTECTED]
> Subject: RE: [sqlite] sqliteOsEnterMutex() and sqliteOsLeaveMutex()
> 
> 
> 
> > Unsolicited advice:  Your best bet is to run no more than 
> one thread 
> > in each process.  If you need multiple threads, create multiple 
> > processes to contain them.  Writing applications with 
> multiple threads 
> > in the same address space is like smoking cigarettes: it 
> gives you a 
> > buzz, but in the long run it is deadly.  Just say "no".
> > 
> > 
> > --
> > D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
> > 
> that depends on the OS. if you do that in windows, for say, a 
> web server, you will kill the envrironment pretty soon, as 
> processes are expensive. it would be fine on Unix, I am told.
> 
> 



RE: [sqlite] Is using max(rowid) instead of count(*) safe?

2004-03-29 Thread Balthasar Indermuehle
Not sure where your performance problems are!?

I created a test database on my laptop (winxp) with my tester app.
Inserted 1 million records with random data. Here's how fast this works,
MAX takes .168ms (milliseconds, not seconds!), count() with a where
clause takes 266ms.

SELECT MIN(rand) AS out FROM t_test returns 1.02212652564049E-6 Time:
.318 ms
--
SELECT MAX(rand) AS out FROM t_test returns 0.98970422894 Time: .168
ms
--
SELECT SUM(rand) AS out FROM t_test returns 500095.604959011 Time:
944.533 ms
--
SELECT AVG(rand) AS out FROM t_test returns 0.500095604959011 time:
950.86 ms
--
SELECT COUNT(*) AS out FROM t_test WHERE rand > 0.5 retrieved 500,516
records. t
ime: 266.787 ms

And this is is with itunes and more running at the same time on the
machine... Maybe you didn't index the table? Indexing makes all the
difference in the world.

Cheers

Balthasar Indermuehle
Inside Systems GmbH
http://www.inside.net

"Louis Pasteur's theory of germs is ridiculous fiction." 
Pierre Pachet, Professor of Physiology at Toulouse, 1872 .  



-Original Message-
From: Cesare D'Amico [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 29, 2004 12:09
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Is using max(rowid) instead of count(*) safe?


Alle 08:54, lunedì 29 marzo 2004, Ali Sadik Kumlali ha scritto:
> I wonder if I could use max(rowid) safely instead of count(*). Does
> rowid increments by 1 for each new row?

As previously stated, it's not safe.

A workaround could be to create an additional table with one field and 
one row, in which you put the number of rows of the other table. At 
every insert or delete on the big table, you should update the value of 
this counter (the best way I can think of is using a trigger, with a 
single atomic update: UPDATE table_counter SET counter = counter + 1).

Ciao
 ce
-- 
Cesare D'Amico - boss (@t) cesaredamico (dot) com
http://www.cesaredamico.com~   http://www.phpday.it
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
  -- The Zen of Python, by Tim Peters


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: [sqlite] Is using max(rowid) instead of count(*) safe?

2004-03-29 Thread Balthasar Indermuehle
In some tests I did, autoincremented primary keys did not produce
sequential numbers. Of a 100 records inserted, I'd get anywhere between
102 and 110 as the highest index, but never the correct number...

cheers

Balthasar Indermuehle
Inside Systems GmbH
http://www.inside.net

"Louis Pasteur's theory of germs is ridiculous fiction." 
Pierre Pachet, Professor of Physiology at Toulouse, 1872 .  



-Original Message-
From: Ali Sadik Kumlali [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 29, 2004 09:18
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Is using max(rowid) instead of count(*) safe?


Bert,

Thanks a lot for this unexpectedly quick response :)

Ali Sadik Kumlali

--- Bert Verhees <[EMAIL PROTECTED]> wrote:
> Ali Sadik Kumlali wrote:
> 
> >Hello,
> >
> >I am working with approximately 3.5 million rows data. As far as I 
> >see count(*) is very slow comparing with max(rowid).
> > 
> >I wonder if I could use max(rowid) safely instead of count(*). Does 
> >rowid increments by 1 for each new row?
> > 
> >Thanks a lot.
> >
> >Ali Sadik Kumlali
> >
> >__
> >Do you Yahoo!?
> >Yahoo! Finance Tax Center - File online. File on time. 
> >http://taxes.yahoo.com/filing.html
> >
>
>-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >  
> >
> When you delete a row in between the rowid's will not be decremented, 
> so it is only save when you never delete a row
> 
> Bert Verhees


__
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Multiuser experience under win32 anyone?

2004-03-15 Thread Balthasar Indermuehle
Hi all,

Has anyone been doing some testing on how sqlite performs in a networked
multiuser environment?

Cheers


Balthasar Indermuehle
Inside Systems GmbH
http://www.inside.net

"Louis Pasteur's theory of germs is ridiculous fiction." 
Pierre Pachet, Professor of Physiology at Toulouse, 1872 .  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] performance tester for SQLite

2004-01-18 Thread Balthasar Indermuehle
Hi all,

I programmed a little performance tester for SQLite. Check this page to
download: http://www.inside.net/sqlite/

Feedback welcome (in particular comparisons with the Linux version).

cheers

-
Balthasar Indermuehle

All science is either physics or stamp collecting.
Ernest Rutherford 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] Autoincrement not sequential

2004-01-15 Thread Balthasar Indermuehle
Hi all,

I'm writing a little performance tester app for sqlite (which btw so far
produces very impressive results!). I'm filling 100,000 records into a
table where the first field is a "integer primary key" so as to let it
increment the number on insert automatically.

Interestingly, it doesn't produce sequential numbers. Sometimes it skips
1 or 2 numbers. There are no triggers associated with that table. Is
that normal?

Cheers

-
Balthasar Indermuehle

All science is either physics or stamp collecting.
Ernest Rutherford 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]