Re: [sqlite] possible bug in overuse of statement journal

2010-02-17 Thread Jeremy Spiegel
> For example, if a table has multiple columns with UNIQUE indexes. But in my case, the table doesn't have any UNIQUE indexes, so it seems that the REPLACE statement can't affect more than one row. This is something that sqlite3GenerateConstraintChecks could check. > The fact that the situation

Re: [sqlite] Aggregate From Two-Table SELECT

2010-02-17 Thread Rich Shepard
On Thu, 18 Feb 2010, P Kishor wrote: > SELECT l.llid, l.name, SUM(s.endKM - s.beginKM) AS distance > FROM lotic AS l JOIN streamlength AS s ON l.llid = s.llid > WHERE l.llid = '1226038453652' > GROUP BY l.llid, l.name Thank you. Now I know. Much appreciated, Rich

Re: [sqlite] Aggregate From Two-Table SELECT

2010-02-17 Thread P Kishor
On Thu, Feb 18, 2010 at 1:06 AM, Rich Shepard wrote: >   I'd appreciate learning how to correctly write a SELECT statement that > reports the SUM of one returned column. > >   I can select all relevant rows, but don't know where to put the > SUM(distance) phrase: > >   SELECT l.llid, l.name, s.end

[sqlite] Aggregate From Two-Table SELECT

2010-02-17 Thread Rich Shepard
I'd appreciate learning how to correctly write a SELECT statement that reports the SUM of one returned column. I can select all relevant rows, but don't know where to put the SUM(distance) phrase: SELECT l.llid, l.name, s.endKM - s.beginKM AS distance FROM lotic AS l, streamlengt

Re: [sqlite] Anyone able to access a SQLite database within a Tclstarpack?

2010-02-17 Thread Matthew Smith
Alexey, that gives me a Tcl VFS inside an SQLite database. I'm looking for the reverse: I'd like to access an SQLite database within a Tclkit--i.e., within a Tcl VFS. Is that possible? It seems that SQLite itself cannot "find" the database, even though a normal file command can see it, give

Re: [sqlite] Anyone able to access a SQLite database within a Tclstarpack?

2010-02-17 Thread Alexey Pechnikov
Hello! On Wednesday 17 February 2010 05:57:51 Matthew Smith wrote: > SQLiteVFS a C-language routine for access any file system, on which the > SQLite database is found. Doesn't appear to give me access to the Tcl VFS. No, you may search vfs::sqlite3 package for Tcl. Best regards, Alexey Pechniko

[sqlite] Memory usage – one data base versus tw o smaller ones

2010-02-17 Thread a1rex
For some reasons it is more convenient for the project to have a few smaller databases with unrelated data than one containing everything. My only concern is RAM memory. How much burden/memory overhead an additional database would introduce? Thank you for your input, Samuel __

Re: [sqlite] Two columns in one index, or one column for each index?

2010-02-17 Thread Tim Romano
You might also see how well INTERSECT performs on your Latitude/Longitude query. Put an index on (float) LAT and another on (float) LON and use an INTEGER primary key in MYTABLE. select * from MYTABLE JOIN ( select id from MYTABLE where (lat >= 30  and lat <= 33) INTERSECT select id from MYTABL

Re: [sqlite] SQLite 3.6.22 ATTACH no longer works for files outside the current working directory

2010-02-17 Thread Simon Slavin
On 17 Feb 2010, at 3:44pm, D. Richard Hipp wrote: > On Feb 17, 2010, at 6:52 AM, Hick Gunter wrote: > >> Ok I went back to square one and retrieved the amalgamation source >> from the recommended distribution. It is still failing at the >> "reduce" step before the "shift 627", which is where

[sqlite] BUG in FTS3 offsets() function in 3.6.22+ version

2010-02-17 Thread Alexey Pechnikov
Hello! See: sqlite> select snippet(file_text) as offsets from file_text where file_text.rowid=7836 and file_text match 'mobigroup'; ...://offline.mts.mobigroup.ru/ ) 2. Выбрать... sqlite> select offsets(file_text) as offsets from file_text where file_text.rowid=7836 and file_text match 'mobigro

Re: [sqlite] SQLite 3.6.22 ATTACH no longer works for files outside the current working directory

2010-02-17 Thread D. Richard Hipp
On Feb 17, 2010, at 6:52 AM, Hick Gunter wrote: > Ok I went back to square one and retrieved the amalgamation source > from the recommended distribution. It is still failing at the > "reduce" step before the "shift 627", which is where the > sqlite3Attach() function is called. > > > [sgi...

Re: [sqlite] possible bug in overuse of statement journal

2010-02-17 Thread Jay A. Kreibich
On Wed, Feb 17, 2010 at 12:35:11AM -0800, Jeremy Spiegel scratched on the wall: > In reading http://www.sqlite.org/tempfiles.html, it sounds like a > statement journal file should only be created for statements that > might change multiple rows and which might abort. It should be > possible for s

[sqlite] possible bug in overuse of statement journal

2010-02-17 Thread Jeremy Spiegel
The following seems to cause a statement journal to be used on every "replace into" statement: > create table T (col1 integer primary key not null, col2 integer not null ); > begin transaction; > replace into T (col1, col2) values (1,2); > replace into T (col1, col2) values (3,4); > ... > commit