Re: [sqlite] Having trouble with "Update"

2010-02-03 Thread Dan Kennedy
On Feb 4, 2010, at 5:20 AM, Ron Hudson wrote: > Pavel Ivanov wrote: >> String constants should be enclosed in single quotes. Double quotes >> are for identifiers. So in your case you make perfectly legal no-op >> action - update field R with value of field R, i.e. leave field R >> unchanged. >>

[sqlite] journaling across multiple databases on read only filesystems

2010-02-03 Thread Rich Rattanni
I got a quick question. I have two databases, one resides on a read only file system, the other is on a writable file system. I routinely copy from the read only copy to the other. I did not realize, until today, that I do not have the protection of transaction support since one database is

[sqlite] When incremental write is committed to the hard drive?

2010-02-03 Thread a1rex
I use UPDATE for text columns in the table and any changes are committed to the hard drive right away (well, after about 120 ms). This can be verified by using external tool. I use SQLite Manager to 'see' the changes. I use also

Re: [sqlite] Any workarounds/suggestions for dropping a not nullconstraint?

2010-02-03 Thread Brian Palmer
On Feb 3, 2010, at 09:58 , Igor Tandetnik wrote: > Brian Palmer wrote: >> Hey all, we've painted ourselves into a bit of a corner and we're >> trying to find the best way out. Through an oversight during initial >> development, we defined a column as not null in our schema and we

Re: [sqlite] Having trouble with "Update"

2010-02-03 Thread Ron Hudson
Pavel Ivanov wrote: > It works because SQLite knows that people often mix single quotes and > double quotes. So when it sees something in double quotes it first > tries to match some identifier to that and if it fails then SQLite > considers it as a string constant. > > Pavel > > On Wed, Feb 3,

Re: [sqlite] Having trouble with "Update"

2010-02-03 Thread Pavel Ivanov
It works because SQLite knows that people often mix single quotes and double quotes. So when it sees something in double quotes it first tries to match some identifier to that and if it fails then SQLite considers it as a string constant. Pavel On Wed, Feb 3, 2010 at 5:20 PM, Ron Hudson

Re: [sqlite] Having trouble with "Update"

2010-02-03 Thread Pavel Ivanov
String constants should be enclosed in single quotes. Double quotes are for identifiers. So in your case you make perfectly legal no-op action - update field R with value of field R, i.e. leave field R unchanged. Pavel On Wed, Feb 3, 2010 at 4:43 PM, Ron Hudson wrote: > I

[sqlite] Having trouble with "Update"

2010-02-03 Thread Ron Hudson
I am using the latest version of sqlite3.exe (version 3.6.22) Running Windows Vista. The sqlite3 executable and the database file are in a subdirectory of my Documents directory (where I know rights are not a problem) In the table named "check", I am trying to update the value in a field

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Jay A. Kreibich
On Wed, Feb 03, 2010 at 10:18:01AM -0800, a1rex scratched on the wall: > ?? I/O data transfer rate - up to 100 Mbps > ?? Sustained data transfer rate - Up to 58 Mbps > ?? Average seek time - 8.5ms > ?? Average latency - 4.16ms > > From this data nothing justifies the 120ms update of the

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Pavel Ivanov
>  Capacity: 120.9 GB >  Speed: 7200 rpm >  Average Read Time:8.5 ms > ... > From this data nothing justifies the 120ms update of the record! Look at 7200 rpm and here http://www.sqlite.org/faq.html#q19. Pavel On Wed, Feb 3, 2010 at 1:18 PM, a1rex wrote: > > Thank you

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Jean-Christophe Deschamps
>I will try to do something to that extent using timer and character >counter. >I hoped that I could update the text stored in the database character >by character as fast as they come from the keyboard driver. >Unfortunately updates noticeably slow down the display of typed >characters.

Re: [sqlite] sqlite3 save points and roll back error

2010-02-03 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 lakshmi pathi wrote: > sqlite3.OperationalError: no such savepoint: pt pysqlite does all sorts of stuff behind the scenes trying to manage transactions for you by default. I believe you can set isolation_level to None to disable that. Else use APSW

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread a1rex
Thank you kindly for all your suggestions! >If you want SQLite to support all ACID properties you cannot change >anything to speed up updates. Making sure that I do not loose a character was my primary objective. > If you are doing bulk updates, and are in a position to re-run the > data

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread David Bicking
As a test, have you tried wrapping your updates in a transaction? That would isolate if the slow down is the actual writing of the data to disk. Where is the file sitting: A local drive, or something across a network connection? David On Wed, 2010-02-03 at 08:51 -0800, a1rex wrote: > >-

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Pavel Ivanov
If you want SQLite to support all ACID properties you cannot change anything to speed up updates. You can only change disks to something with higher rotation speeds or some non-rotational ones (although I'm not sure that they will be faster). Another thing to try is change your application

Re: [sqlite] parallelizing an update

2010-02-03 Thread Robert Citek
On Tue, Feb 2, 2010 at 11:20 AM, Nicolas Williams wrote: > On Tue, Feb 02, 2010 at 09:23:36AM +0100, Sylvain Pointeau wrote: >> I would be very interested to see some benchmark, just to see. > > Feel free to write the relevant program, schema, SQL statements and run

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Igor Tandetnik
a1rex wrote: > Retraction. Mea Culpa. Back to square one… > The modified code did not write anything to the drive! But there was > no error message from the SQLITE. Why should there be? You have a legal statement - essentially update notes set note=1 where id='note text';

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Jay A. Kreibich
On Wed, Feb 03, 2010 at 08:51:46AM -0800, a1rex scratched on the wall: > >- Original Message > >From: Pavel Ivanov > >To: General Discussion of SQLite Database > >Sent: Wed, February 3, 2010 11:37:17 AM > > >Just first thought came to my

Re: [sqlite] Any workarounds/suggestions for dropping a not nullconstraint?

2010-02-03 Thread Igor Tandetnik
Brian Palmer wrote: > Hey all, we've painted ourselves into a bit of a corner and we're > trying to find the best way out. Through an oversight during initial > development, we defined a column as not null in our schema and we > need to drop that not null constraint. > > Since

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread a1rex
>- Original Message >From: Pavel Ivanov >To: General Discussion of SQLite Database >Sent: Wed, February 3, 2010 11:37:17 AM >Just first thought came to my mind: are you sure that 2 versions of >code mentioned do the same thing? In particular

Re: [sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread Pavel Ivanov
Just first thought came to my mind: are you sure that 2 versions of code mentioned do the same thing? In particular I'm asserting that second version (under #if 1) doesn't do any actual updating and doesn't change your database because you have wrong parameter indexes. And one more question: why

[sqlite] Any workarounds/suggestions for dropping a not null constraint?

2010-02-03 Thread Brian Palmer
Hey all, we've painted ourselves into a bit of a corner and we're trying to find the best way out. Through an oversight during initial development, we defined a column as not null in our schema and we need to drop that not null constraint. Since sqlite3 doesn't support altering columns, I know

Re: [sqlite] UTF-8 and UTF-16

2010-02-03 Thread a1rex
>From: Jens Miltner >Sent: Wed, February 3, 2010 9:46:06 AM >Just another thought to consider: depending on the amount of non-ASCII >(or non-roman) string data stored in your database, in may be more >efficient to use UTF-8 encoding rather than UTF-16 encoding: >UTF-8 takes up

[sqlite] Shocked by long updates of the text database, 1000 speed improvement after small modification to the code.

2010-02-03 Thread a1rex
I just encountered very curious case in Sqlite. I have very simple data base with only one table and one index: "CREATE TABLE IF NOT EXISTS notes(id INTEGER PRIMARY KEY, note TEXT)"; My updates to the simple text database were very slow. Extremely slow! I changed my code and achieved 1000

Re: [sqlite] UTF-8 and UTF-16

2010-02-03 Thread Jens Miltner
Am 01.02.2010 um 00:02 schrieb a1rex: > I am planning to store text in a database which has to accommodate a > few international languages. > In this case I have to use UTF-16LE encoding for my TEXT fields. > I know that once an encoding has been set for a database, it cannot > be changed.

[sqlite] DB Corruption

2010-02-03 Thread ramesh.kotabagi
Hi All, I'm Ramesh, currently we are using sqlite-3.5.8 version, mainly(sqlite3.h and sqlite3.c) files API to perform DB operations like 1) insert to, 2) delete from, 3) select from,

[sqlite] sqlite3 save points and roll back error

2010-02-03 Thread lakshmi pathi
Hi all, I'm working on a sqlite3 with python program.Here is the code snippet def save_point(self): self.db.execute("savepoint pt;") print "Save point created" self.cursor.execute("insert into STK values(33)")