Re: [sqlite] Support for clustered indexing (or something similar)?

2008-10-26 Thread Dan
On Oct 27, 2008, at 12:38 PM, Julian Bui wrote: > Thanks for the reply dan. > > You probably don't "need" clustered indexing as such, but this would > be >> >> the kind of case where it provides some advantages. You can get the >> same >> effect in SQLite by including all the data columns in

Re: [sqlite] Support for clustered indexing (or something similar)?

2008-10-26 Thread Julian Bui
Thanks for the reply dan. You probably don't "need" clustered indexing as such, but this would be > > the kind of case where it provides some advantages. You can get the same > effect in SQLite by including all the data columns in your index > definition. > > Unfortunately, because I will be

Re: [sqlite] Support for clustered indexing (or something similar)?

2008-10-26 Thread Dan
On Oct 26, 2008, at 5:15 PM, Julian Bui wrote: > Hi all, > > I have records w/ a timestamp attribute which is not unique and > cannot be > used as a primary key. These records will be inserted according to > timestamp value. From this important fact, I've gathered I need a > clustered >

Re: [sqlite] last_insert_rowid() syntax

2008-10-26 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Karl Lautman wrote: > Can someone point out to me the syntax error in the following? I've omitted > the set-up code for brevity, but cur is a cursor with a connection to the > database. Thanks. > x = cur.execute('last_insert_rowid()')

Re: [sqlite] Vacuum needed?

2008-10-26 Thread Mohit Sindhwani
Cory Nelson wrote: > On Sun, Oct 26, 2008 at 8:17 PM, Mohit Sindhwani <[EMAIL PROTECTED]> wrote: > >> I'm setting to to delete a bunch of old records ever 2 weeks in a cron >> job and initially I just wanted to do delete * from table where >> datetime(created_on, 'localtime') < some_date. >> >>

Re: [sqlite] Vacuum needed?

2008-10-26 Thread Cory Nelson
On Sun, Oct 26, 2008 at 8:17 PM, Mohit Sindhwani <[EMAIL PROTECTED]> wrote: > I'm setting to to delete a bunch of old records ever 2 weeks in a cron > job and initially I just wanted to do delete * from table where > datetime(created_on, 'localtime') < some_date. > > Then, I remembered about

[sqlite] last_insert_rowid() syntax

2008-10-26 Thread Karl Lautman
Can someone point out to me the syntax error in the following? I've omitted the set-up code for brevity, but cur is a cursor with a connection to the database. Thanks. >>> x = cur.execute('last_insert_rowid()') Traceback (most recent call last): File "", line 1, in x =

[sqlite] Vacuum needed?

2008-10-26 Thread Mohit Sindhwani
I'm setting to to delete a bunch of old records ever 2 weeks in a cron job and initially I just wanted to do delete * from table where datetime(created_on, 'localtime') < some_date. Then, I remembered about vacuum - do I need to vacuum the database whenever I delete the records? Should I just

Re: [sqlite] Sqlite3 delete action is too slow

2008-10-26 Thread PennyH
My question is How can improve delete speed? This speed can not satisfy my application. Igor Tandetnik wrote: > > "yhuang" <[EMAIL PROTECTED]> > wrote in message news:[EMAIL PROTECTED] >> I create a DB and only one table in the DB. There are 3641043 records >> in the DB file. Min id is

[sqlite] Replay logging best practices

2008-10-26 Thread David Barrett
What's the right way to use update/commit/rollback hooks to produce a replay log? Currently I'm doing it at a high level by just recording all SQL statements into a replay log, and that works really well except fails in some cases like with the use of CURRENT_TIMESTAMP. (Replaying that will

Re: [sqlite] database growing surprising rapidly

2008-10-26 Thread P Kishor
On 10/26/08, Julian Bui <[EMAIL PROTECTED]> wrote: > Puneet, I think I see what you're saying about the data types and their > affinities, but what does that have to do with the MUCH bigger table size > than what was expected? > That you were expecting smallint and bigint to behave the way they

Re: [sqlite] database growing surprising rapidly

2008-10-26 Thread D. Richard Hipp
On Oct 26, 2008, at 5:58 PM, Julian Bui wrote: > HI everyone, > > I have records in my db that consist of smallint, bigint, smallint, > double, > char(8). By my calculation that comes to 2 + 8 + 2 + 8 + 8 = 28 > Bytes per > record. I also have an index over the attribute that is a double.

Re: [sqlite] database growing surprising rapidly

2008-10-26 Thread Julian Bui
Puneet, I think I see what you're saying about the data types and their affinities, but what does that have to do with the MUCH bigger table size than what was expected? Also, I made a mistake. In an attempt to censor out my table name and attribute names I forgot to fix everything. So yes, I

Re: [sqlite] database growing surprising rapidly

2008-10-26 Thread P Kishor
On 10/26/08, Julian Bui <[EMAIL PROTECTED]> wrote: > HI everyone, > > I have records in my db that consist of smallint, bigint, smallint, double, > char(8). By my calculation that comes to 2 + 8 + 2 + 8 + 8 = 28 Bytes per > record. I also have an index over the attribute that is a double.

[sqlite] database growing surprising rapidly

2008-10-26 Thread Julian Bui
HI everyone, I have records in my db that consist of smallint, bigint, smallint, double, char(8). By my calculation that comes to 2 + 8 + 2 + 8 + 8 = 28 Bytes per record. I also have an index over the attribute that is a double. I inserted 100,000 records into a clean database and the database

[sqlite] Fwd: Help! Excel-->SQLite -- getting numbers to behave like numbers!

2008-10-26 Thread David Akin
Cancel that last plea of help: Excel was adding a trailng space in one of the fields containing numbers which I did not discover until looking at the CSV file in text editor. A quick search-and-replace later, I've dumped the data backed into SQLite and problem is solved ... --

[sqlite] Help! Excel-->SQLite -- getting numbers to behave like numbers!

2008-10-26 Thread David Akin
I'm fiddling with SQLite running on Mac OSX and am using the Firefox extension SQLite Manager ... I have some Excel tables I'd like to re-create in SQLite. It looks easy to me: 1. Save your Excel table as a .csv file. 2. In SQLite Manager used DATABASE-->IMPORT ... and follow the directions.

Re: [sqlite] Obtaining last row's primary key value

2008-10-26 Thread P Kishor
On 10/26/08, Karl Lautman <[EMAIL PROTECTED]> wrote: > Let's say I've just added a record to a table where one of the columns is > designated an integer primary key, and I have sqlite autoincrement that > column for me with each insert. Now I need to add some records to other > tables linked

[sqlite] Obtaining last row's primary key value

2008-10-26 Thread Karl Lautman
Let's say I've just added a record to a table where one of the columns is designated an integer primary key, and I have sqlite autoincrement that column for me with each insert. Now I need to add some records to other tables linked to the first record. So I want to use the first record's PK

Re: [sqlite] rtree cast warnings on 64bit OS - strange parameter use

2008-10-26 Thread William Kyngesburye
On Oct 25, 2008, at 12:21 PM, Dan wrote: >> I thought the two pAux parameters were odd - one bare and one cast to >> (int), so I looked up rtreeInit(). > > Good point. I removed the first of the two "pAux" parameters from > rtreeInit(). It was not being used. > >

Re: [sqlite] setting the timezone on windows xp

2008-10-26 Thread Jay Sprenkle
Thanks Doug. On Sat, Oct 25, 2008 at 11:48 AM, Doug <[EMAIL PROTECTED]> wrote: > Hi Jay -- > > I used to have a problem like this a few years back. I don't remember all > the hows and whys, but my apps call the following at start up and the > problems are gone: > > _tsetlocale(LC_ALL, _T(""));

[sqlite] Support for clustered indexing (or something similar)?

2008-10-26 Thread Julian Bui
Hi all, I have records w/ a timestamp attribute which is not unique and cannot be used as a primary key. These records will be inserted according to timestamp value. From this important fact, I've gathered I need a clustered index since my SELECT statements use a time-range in the WHERE clause.