Re: [sqlite] COUNT() on indexed tables / primary keywith 100'000records

2008-07-14 Thread [EMAIL PROTECTED]
Hello Thank you for you quick responses. If I disable the index with + it takes around 50% more execution time. I supposed a very fast query even with many records, because COUNT( ) might do its work on the index only. I this case, I have to find another solution to get the number of records

[sqlite] speeding outer joins

2008-07-14 Thread Tim Mohler
Hi all, I have an application where users can tag news stories with custom tags. I present the latest 20 stories along with all of the tags the user has applied. I wind up with a three-table schema and in order to get all the stories with their tags at once regardless of whether a story has a tag

Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-14 Thread Michael Knigge
See page http://www.sqlite.org/draft/doc/35to36.html "Added the page_count PRAGMA for returning the size of the underlying database file in pages." I guess you mean "... the **count**" and not **size**. Bye, Michael ___ sqlite-users

[sqlite] Problem with Inner Join

2008-07-14 Thread Ralf
Hello, I'm having problems with Inner Joins on m:n relations book <--> bookauthor <--> author SELECT authorname FROM author INNER JOIN book INNER JOIN bookauthor ON book.Id_book = bookauthor.Id_book ON author.Id_author = bookauthor.Id_author WHERE bookltitle='title' I receive an

[sqlite] Problem writing to database using PHP under OS X

2008-07-14 Thread Tim Streater
I have a small script which shows this problem: if I run it from the command line I can read from and write to the database. If I run it in a browser it fails at the write with "General error: 14 unable to open database file" (having done the read OK first). The database has permissions

Re: [sqlite] Problem with Inner Join

2008-07-14 Thread Simon Davies
2008/7/14 Ralf <[EMAIL PROTECTED]>: > I'm having problems with Inner Joins on m:n relations > > book <--> bookauthor <--> author > > SELECT authorname FROM author INNER JOIN book INNER JOIN bookauthor ON > book.Id_book = bookauthor.Id_book ON author.Id_author = bookauthor.Id_author > WHERE

Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-14 Thread Mihai Limbasan
Michael Knigge wrote: > See page > > http://www.sqlite.org/draft/doc/35to36.html > > > "Added the page_count PRAGMA for returning the size of the underlying > database file in pages." > > I guess you mean "... the **count**" and not **size**. > Could be phrased better, but as it is

Re: [sqlite] COUNT() on indexed tables /primary keywith 100'000records

2008-07-14 Thread Igor Tandetnik
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I supposed a very fast query even with many records, because COUNT( ) > might do its work on the index only. Well, it does, but the work is still proportional to the number of records counted. The index helps to quickly filter out

Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-14 Thread Michael Knigge
> Could be phrased better, but as it is it's perfectly correct. PRAGMA > page_count returns the size of the underlying database, measured in > units of pages needed. Yes, you are right - my fault. Sorry! bye, Michael ___ sqlite-users mailing list

Re: [sqlite] speeding outer joins

2008-07-14 Thread Igor Tandetnik
"Tim Mohler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > select stories.*,tags.name from stories left outer join story_tags on > stories.article_id = story_tags.article_id left outer join tags on > story_tags.tag_id = tags.id and stories.article_id in (select > article_id from

[sqlite] Problem with Inner Join

2008-07-14 Thread Ralf Jantschek
Hello, I'm having problems with Inner Joins on m:n relations book <--> bookauthor <--> author SELECT authorname FROM author INNER JOIN book INNER JOIN bookauthor ON book.Id_book = bookauthor.Id_book ON author.Id_author = bookauthor.Id_author WHERE bookltitle='title' I receive an

Re: [sqlite] bug with NULL in NOT IN

2008-07-14 Thread peter
On Wed, Jun 25, 2008 at 05:33:04PM +0200, [EMAIL PROTECTED] wrote: > mysql, postgres and mssql correctly return zero rows. SQLite > however returns two rows, for id=1 and id=2. > > http://www.sqlite.org/nulls.html doesn't list it, so perhaps > this has never come up before.

Re: [sqlite] Problem with Inner Join

2008-07-14 Thread P Kishor
On 7/14/08, Ralf Jantschek <[EMAIL PROTECTED]> wrote: > Hello, > > > > I'm having problems with Inner Joins on m:n relations > > book <--> bookauthor <--> author > > > > SELECT authorname FROM author INNER JOIN book INNER JOIN bookauthor ON > book.Id_book = bookauthor.Id_book ON

Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-14 Thread Virgilio Fornazin
Patch posted to CVSTRAC timeline. Please take a look. Ticket n# 3218 On Sun, Jul 13, 2008 at 11:04 AM, Virgilio Fornazin < [EMAIL PROTECTED]> wrote: > Thanks for your quick answer... I'll take a look at it to see and submit a > patch to cvstrac if needed. > > Also, thanks again for this great

Re: [sqlite] Problem writing to database using PHP under OS X

2008-07-14 Thread John LeSueur
On Mon, Jul 14, 2008 at 4:28 AM, Tim Streater <[EMAIL PROTECTED]> wrote: > I have a small script which shows this problem: if I run it from the > command line I can read from and write to the database. If I run it in a > browser it fails at the write with "General error: 14 unable to open >

[sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Ken
sqlite 3.5.9 and AIX 5.3 Upon commit of a main DB with an attached DB sqlite returns (1290) 0x50A SQLITE_IOERR_DIR_FSYNC what would cause this? Any ideas on how to resolve? Thanks, Ken ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread D. Richard Hipp
On Jul 14, 2008, at 1:31 PM, Ken wrote: > sqlite 3.5.9 and AIX 5.3 > > Upon commit of a main DB with an attached DB sqlite returns (1290) > 0x50A SQLITE_IOERR_DIR_FSYNC > > > what would cause this? Any ideas on how to resolve? SQLite is attempting to fsync() a directory after unlinking

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread John Stanton
On earlier versions of AIX Sqlite has no issues. This problem might not be inherent to AIX V5.3. D. Richard Hipp wrote: > On Jul 14, 2008, at 1:31 PM, Ken wrote: > >> sqlite 3.5.9 and AIX 5.3 >> >> Upon commit of a main DB with an attached DB sqlite returns (1290) >> 0x50A

Re: [sqlite] Aliasing and columns names

2008-07-14 Thread Kris Groves
On Thursday 10 July 2008 15:17:50 D. Richard Hipp wrote: > On Jul 10, 2008, at 7:57 AM, Evgeni Alesinskyy wrote: > > Hi all, > > > > I develop application in C# that has to run with MySQL and SQLite. > > At some point I need to join 2 tables and bind them resp. dataset > > containing the union to

[sqlite] Datetime issue with the time part

2008-07-14 Thread Sebastien Robillard
Hi everyone, I have an issue with datetimes that doesn't return the "time" part correctly (always 00:00:00 or 18:00:00) when I use SQLite in my C++ code. Whenever I use datetime('now'), or current_timestamp, the time is not correct. However, it works correctly when using the sqlite3

[sqlite] New feature suggestion

2008-07-14 Thread Shawn Wilsher
Hey all, Over at mozilla, we have an interest to keep other applications from writing to our database. To accomplish this, we open the database with an exclusive lock using the locking_mode pragma. However, this means other processes cannot even read our database. What we'd like to see is a

Re: [sqlite] SQLite 3.6.0 coming soon...

2008-07-14 Thread Jeremy Hinegardner
On Sat, Jul 12, 2008 at 05:00:32PM -0400, D. Richard Hipp wrote: > If you sees any problems with the upcoming release, or finds omissions > or errors or ambiguities in the documentation, now would be a very > good time to speak up. Thank you for your attention.

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Ken
This might be an error on my side since the normal .db handling seems to function ok. The main .db is opened using sync_mode=off. So I shouldn't even get this particular error. I'll dig deeper into this and post more info once I validate the source of the error. John Stanton <[EMAIL

Re: [sqlite] Datetime issue with the time part

2008-07-14 Thread Eric Minbiole
Sebastien Robillard wrote: > Hi everyone, > I have an issue with datetimes that doesn't return the "time" part > correctly (always 00:00:00 or 18:00:00) when I use SQLite in my C++ > code. Whenever I use datetime('now'), or current_timestamp, the time is > not correct. However, it works

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Ken
Ok this is really weird. One sqlite Db functions fine. A second db (connection to a different db) commits and does not delete the journal file. I have verified that data is being written and the journal does indeed have the original blocks. Where in the source does sqlite make the decision

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Ken
On the second commit I found that the locking_mode=exclusive caused the journal to merly be truncated vs deleted. I put the locking mode back to normal. It looks like the IOERR_DIR_FSYNC is due to the fact that a MJ journal is not being created! Pragma synchronous=OFF was in effect. The same

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Ken
Preprocessor Macro: #if defined (_AIX) Looks like the MJ file is not getting created, sqlite 3.5.9 This is also reproducible via the command line: Possibly an issue with the journal mode code that was introduced. SQLite version 3.5.9 Enter ".help" for instructions sqlite> attach

Re: [sqlite] Datetime issue with the time part

2008-07-14 Thread Sebastien Robillard
Eric Minbiole wrote: > Sebastien Robillard wrote: > >> Hi everyone, >> I have an issue with datetimes that doesn't return the "time" part >> correctly (always 00:00:00 or 18:00:00) when I use SQLite in my C++ >> code. Whenever I use datetime('now'), or current_timestamp, the time is >>

Re: [sqlite] Datetime issue with the time part

2008-07-14 Thread Eric Minbiole
> Once again, all of these problems doesn't happen before the creation of > the Direct3D device. Does anyone ever used SQLite successfully in a > full-screen 3D game ? From what you describe, it seems that the compiler is performing single-precision, rather than double-precision, math. After

Re: [sqlite] SQLite C++

2008-07-14 Thread dcharno
Darko Miletic wrote: >> Maybe he is looking for a C++ wrapper for Sqlite. > > Than look no further. SOCI is the definite sqlite c++ wrapper. > > http://soci.sourceforge.net/ This wrapper looked really promising. But, the SQLite backend wasn't being maintained and is no longer officially

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ken wrote: > open("/home/ixion/ix_propagator/data/db/ajax102/batch", O_RDONLY|O_LARGEFILE) > = 10 > kfcntl(10, F_GETFD, 0x) = 0 > kfcntl(10, F_SETFD, 0x0001) = 0 > fsync(10)

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Dan
On Jul 15, 2008, at 4:46 AM, Ken wrote: > Preprocessor Macro: >#if defined (_AIX) > > Looks like the MJ file is not getting created, sqlite 3.5.9 This is > also reproducible via the command line: Possibly an issue with the > journal mode code that was introduced. >

Re: [sqlite] IOERR_DIR_FSYNC on main db

2008-07-14 Thread Dan
On Jul 15, 2008, at 9:00 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Ken wrote: > >> open("/home/ixion/ix_propagator/data/db/ajax102/batch", O_RDONLY| >> O_LARGEFILE) = 10 >> kfcntl(10, F_GETFD, 0x) = 0 >> kfcntl(10, F_SETFD, 0x0001)