Re: [sqlite] Advice on which to use (SQLite or SQL Server) for the following app.

2009-06-11 Thread Petite Abeille
On Jun 11, 2009, at 4:53 PM, Sam Carleton wrote: > I am a late comer to this discussion, so this might have already > been purposed... Additionally, if this was not mentioned already, you can partition your database across multiple physical files through the magic of 'attach database' or s

Re: [sqlite] Advice on which to use (SQLite or SQL Server) for the following app.

2009-06-11 Thread Petite Abeille
On Jun 11, 2009, at 9:05 PM, Jim Wilcoxson wrote: > you will have to place each on its own physical disk drive to > increase transaction rates. Arguably, such micro management of what data block sits on what disk spindle would be better left to the underlying volume manager or such. A bit O

Re: [sqlite] Heirarchical queries question

2009-07-20 Thread Petite Abeille
On Jul 17, 2009, at 11:18 PM, Igor Tandetnik wrote: > This is known as a nested-set model: > > http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Perhaps of interest as well: Trees in the database: Advanced data structures http://www.alberton.info/talks http://www.slideshare.n

Re: [sqlite] How to disable fsync() in SQLite

2009-07-27 Thread Petite Abeille
On Jul 27, 2009, at 8:31 PM, W.-H. Gu wrote: > Is there a way to disable fsync() pragma synchronous = off http://www.sqlite.org/pragma.html#pragma_synchronous -- PA. http://alt.textdrive.com/nanoki/ ___ sqlite-users mailing list sqlite-users@sqlite.o

Re: [sqlite] Tedious CSV import question

2009-09-24 Thread Petite Abeille
On Sep 24, 2009, at 11:47 PM, Jay A. Kreibich wrote: > The bigger issue is that CSV isn't really a format, but more of a > loose idea. Right, that said, sticking to RFC 4180 is not such a bad bet: Common Format and MIME Type for Comma-Separated Values (CSV) Files http://www.rfc-editor.org/rfc/

Re: [sqlite] Tedious CSV import question

2009-09-25 Thread Petite Abeille
On Sep 25, 2009, at 4:00 PM, Jay A. Kreibich wrote: > According to the RFC Excel doesn't use double-quotes for anything. Don't believe everything written on the interweb :P Contemporary version of Excel properly quote everything that needs to be quoted. _

Re: [sqlite] Tedious CSV import question

2009-09-25 Thread Petite Abeille
On Sep 25, 2009, at 7:33 PM, Wilson, Ronald wrote: > I read the RFC last night Oh, my... Programming in Lua has a nice, concise example regarding CSV parsing (near the end of the page): http://www.lua.org/pil/20.4.html Quote: To break a CSV into an array is more difficult, because we must

Re: [sqlite] TH3 license

2009-09-25 Thread Petite Abeille
On Sep 25, 2009, at 9:13 PM, D. Richard Hipp wrote: > http://www.sqlite.org/th3.html There is a small HTML typo on that page, line 108: 2.0 Operation Should be . ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mai

Re: [sqlite] Tedious CSV import question

2009-09-25 Thread Petite Abeille
On Sep 25, 2009, at 9:21 PM, C. Mundi wrote: > Your post neatly articulates virtually every facet of this issue. > Thank you. I wish we could get everyone to stop using csv. I hate to > look at xml but I often wish everyone would use it instead of csv. In fact, in Switzerland, there is a feder

Re: [sqlite] Tedious CSV import question

2009-09-26 Thread Petite Abeille
On Sep 25, 2009, at 9:03 PM, Wilson, Ronald wrote: > Yeah. The clearest thing in the RFC is the ABNF grammar. However, > even > that leaves out common cases like white space outside of quoted > fields, > which most people would expect to be trimmed. Also, I think most > people > would ex

Re: [sqlite] Tedious CSV import question

2009-09-28 Thread Petite Abeille
On Sep 27, 2009, at 7:35 PM, Nuno Lucas wrote: > Some time ago I had to do something similar and decided to write a > small > virtual table implementation to treat CSV files as just another table. Very nice :) Similar to Oracle's "external table": "External Tables" http://www.orafaq.com/node

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Petite Abeille
On Sep 29, 2009, at 6:32 PM, Joe Bennett wrote: > Have two tables structured exactly the same. Want to compare both of > them and get the delta. Been Googling for about an hour now and I see > tools that do this (maybe a freeware one I haven't found?) and was > looking for a solution that more me

Re: [sqlite] Comparing two tables?

2009-09-29 Thread Petite Abeille
On Sep 29, 2009, at 6:50 PM, Cory Nelson wrote: > i believe he means except, not minus. Correct. Got my SQL dialects intermingled :) > If all you need is differing > rows, this will work like a charm. Otherwise if you need a more > fine-grained delta like only returning columns that changed, y

Re: [sqlite] sqlite-users Digest, Vol 21, Issue 122

2009-09-29 Thread Petite Abeille
On Sep 29, 2009, at 7:19 PM, Wilson, Ronald wrote: > I can't find the .timer feature in the SQLite command line utility. sqlite> .timer on sqlite> select 1; 1 CPU Time: user 0.000295 sys 0.000269 sqlite> ___ sqlite-users mailing list sqlite-users@sql

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Petite Abeille
On Sep 30, 2009, at 10:55 PM, Joe Bennett wrote: > I'm not sure I'm far enough along with sqlite to maybe get what ya'll > are telling me... Right... with SQL it helps to thing in terms of set operations instead of procedural code... here is an illustration to get you started: "A Visual Expla

Re: [sqlite] Comparing two tables?

2009-09-30 Thread Petite Abeille
On Sep 30, 2009, at 11:41 PM, Simon Slavin wrote: > It would be technically possible to write some clever SQL to do it all > in one operation. Why the "clever" characterization? > But it would be complicated to debug and ... well, > do you really want to waste the time getting it right ? Hmmm

Re: [sqlite] Table within a table??

2009-11-01 Thread Petite Abeille
On Nov 1, 2009, at 2:32 AM, Jay A. Kreibich wrote: > Anyways... I've gone on long enough. Good luck with your design. > Think a bit, ask good questions, and hopefully we can all see > a different point of view and learn to see something new. Excellent post, thank you :) Along the same lines

[sqlite] [noob] merge statement equivalent?

2008-04-10 Thread Petite Abeille
Hello, How does one emulate a DML MERGE statement in SQLite [1]? INSERT OR REPLACE sounds promising but the REPLACE documentation under the ON CONFLICT clause seems to imply that in the case of a constraint violation the existing row will be deleted entirely and then replaced by a brand new

[sqlite] Table modifications and analyze

2008-04-14 Thread Petite Abeille
Hello, What heuristics do people use to determine the frequency for analyzing their indices? Is there something equivalent to user_tab_modifications that keep tracks of the number of inserts, updates and deletes for each table? Thanks in advance. Kind regards, -- PA. http://alt.textdrive.c

[sqlite] integer primary key and unique index?

2008-04-15 Thread Petite Abeille
Hello, Would adding an unique index on an integer primary key be of any benefit? Or is it redundant? In "Primary key and index", Ben Carlyle wrote the following: 1 Table = 1 BTree, the BTree holds the data and is ordered by ROWID 1 Table with 1 Index = 2 BTrees, the second referring to rows in

Re: [sqlite] [OT] Program to document database lay out

2008-04-16 Thread Petite Abeille
On Apr 16, 2008, at 12:09 AM, Hartwig Wiesmann wrote: > I am looking for a program that can visualize the relations between > different tables, their connections and indices. Martin Krzywinski's Schemaball is rather interesting: http://www.visualcomplexity.com/vc/project_details.cfm?id=42&in

[sqlite] explain query plan?

2008-04-17 Thread Petite Abeille
Hello, In "index using and explain using question", Dennis Cote wrote: "An EXPLAIN QUERY PLAN returns three columns. The output of explain query plan is not documented (to the best of my knowledge anyway), but is fairly self explanatory. It shows the order that tables are scanned and which i

[sqlite] query execution plan inconsistency?

2008-04-26 Thread Petite Abeille
Hello, [sqlite 3.5.8, Mac OS X 10.5.2] Given the following schema [1]: document <->> document_token <<-> token I'm trying to retrieve some documents with a set of token(s) [2]. Things works rather fine when looking for multiple tokens: select sum( document_token.weight ) as score,

Re: [sqlite] accented characters upper/lower case in SELECT LIKE statements

2008-05-01 Thread Petite Abeille
On May 1, 2008, at 4:09 PM, Jay A. Kreibich wrote: > As the document referenced above explains, you can create a user > function called "like(A,B)" that will over-ride the built-in behavior > for LIKE. If you're only dealing with one language, such as > Brazilian-Portuguese, then you can jus

Re: [sqlite] property/config file for SQLite

2008-05-02 Thread Petite Abeille
On May 2, 2008, at 8:50 PM, [EMAIL PROTECTED] wrote: > Is there a way to configure SQLite using a property/config file? > Is changing the source code the only way to affect how it behaves? Have you looked at pragmas? http://www.sqlite.org/pragma.html -- PA. http://alt.textdrive.com/nanoki/ __

Re: [sqlite] SQLite version 3.5.9

2008-05-14 Thread Petite Abeille
Hello, On May 14, 2008, at 7:17 PM, D. Richard Hipp wrote: > There is also a new *experimental* PRAGMA called "journal_mode" > which can provide performance improvements under some circumstances. I'm trying the new journal_mode pragma: % uname -v Darwin Kernel Version 9.2.2; root:xnu-1228.4

Re: [sqlite] SQLite version 3.5.9

2008-05-14 Thread Petite Abeille
On May 14, 2008, at 8:10 PM, D. Richard Hipp wrote: > Works for me. Did you compile the shell yourself or use the prebuilt > binary? I did compile it myself. Any additional configuration(s) one should take care of to enable this pragma? ___ sqlite-

Re: [sqlite] SQLite version 3.5.9

2008-05-14 Thread Petite Abeille
On May 14, 2008, at 8:10 PM, D. Richard Hipp wrote: > > Works for me. Did you compile the shell yourself or use the prebuilt > binary? Ooops... never mind... the shell works fine... I was using sqlite3_prepare and my application was linked against a different version of the lib... Everythi

Re: [sqlite] Exceptions to sorting?

2008-05-16 Thread Petite Abeille
On May 16, 2008, at 10:23 PM, Andrés G. Aragoneses wrote: > If I use "ORDER BY ItemName = '', ItemNameLowered" I get 2,1,3 and I > want to get 1,3,2. Any ideas? Perhaps something like: select * from item order by case when name = '' then 'z' else name end

Re: [sqlite] Exceptions to sorting?

2008-05-16 Thread Petite Abeille
On May 16, 2008, at 10:41 PM, Igor Tandetnik wrote: > That would sort 'zebra' after ''. Well... this is meant as an example... 'z' should be whatever character one deems appropriate, e.g. '{' or whatever utf-8 sequence does the job. -- PA. http://alt.textdrive.com/nanoki/ __

Re: [sqlite] Exceptions to sorting?

2008-05-16 Thread Petite Abeille
On May 16, 2008, at 10:40 PM, Andrés G. Aragoneses wrote: > Interesting, but the replacement to 'z' seems kind of a hack, I would > not prefer magic strings... Well... it doesn't have to be 'z'... it's just an example... choose whatever character sequence is relevant to get the proper ordering

Re: [sqlite] Exceptions to sorting?

2008-05-17 Thread Petite Abeille
On May 16, 2008, at 11:07 PM, Igor Tandetnik wrote: > Well, for any string A there exists another string B that sorts > after A. > How can I guarantee that, after I choose A as my "sorts after > everything" marker, somebody doesn't put B into the database? Well... not to beat a dead horse or a

Re: [sqlite] FTS3 Question

2008-05-17 Thread Petite Abeille
On May 17, 2008, at 9:49 AM, Mike Marshall wrote: > SELECT guid FROM data WHERE text MATCH SELECT query FROM category Perhaps something along these lines: select data.guid fromdata joincategory on category.guid = data.guid where data.text match category.query Or something :) -- PA.

Re: [sqlite] Extracting data from second table: Sub-query? Outer join?

2008-05-27 Thread Petite Abeille
On May 27, 2008, at 3:21 PM, Gilles Ganault wrote: > I have two tables, and I'd like to SELECT rows from table1 where an > item it not in table2 Something along these lines: selecttable1.* from table1 left join table2 ontable2.employee = table1.employee ... where tabl

[sqlite] 'insert or ignore' vs self join?

2008-05-27 Thread Petite Abeille
Hello, % sqlite3 -version 3.5.9 I'm trying to figure out a frugal way to handle a unique key constrain... I tried using both 'insert or ignore' and a self join. The self join seems to be noticeably faster even though 'insert or ignore' would empirically appear to be the better deal (shorte

Re: [sqlite] 'insert or ignore' vs self join?

2008-05-28 Thread Petite Abeille
Hello, On May 27, 2008, at 9:07 PM, Stephen Oberholtzer wrote: > Well, the first thing you should bring away from this experience is > that the > number of VM instructions isn't really an indicator of how efficient > the > query is :) Good point :) > Now, I'm not sure exactly why one is fas

Re: [sqlite] Can't create table from a trigger

2008-05-28 Thread Petite Abeille
Hello, On May 27, 2008, at 9:47 PM, [EMAIL PROTECTED] wrote: > Is this a limitation, or am I missing something? Creating tables dynamically is not very useful in general, so perhaps this is misguided, yes :) On the other hand, an alternative I found useful is to use SQLite's 'attach databas

Re: [sqlite] How to speed up my queries?

2008-06-03 Thread Petite Abeille
On Jun 3, 2008, at 7:27 PM, Christophe Leske wrote: > i am a new member of this list and interested in speeding up my > sqlite queries. There are no magic bullets, but "The SQLite Query Optimizer Overview" is a good read: http://www.sqlite.org/optoverview.html As well as "Query Plans": ht

Re: [sqlite] SQL questions

2008-06-27 Thread Petite Abeille
On Jun 27, 2008, at 7:15 PM, Igor Tandetnik wrote: > Personally, I never saw any DBMS that supported anything like this. I > can't prove that none such exists, of course. Oracle provides something called Function Based Indexes: http://download.oracle.com/docs/cd/B10501_01/appdev.920/a96590/adg0

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread Petite Abeille
On Jun 28, 2008, at 8:10 PM, [EMAIL PROTECTED] wrote: > I see. Do you have any suggestions on where I can find out about how > to get more specific timing information? I'm pretty much an sqlite > novice. In the sqlite3 command line: .timer ON|OFF Turn the CPU timer measurement on or

[sqlite] [ANN] IPLocation.db

2008-07-09 Thread Petite Abeille
Hello, IPLocation.db provides access to MaxMind's GeoLite City data as a - rather hefty- SQLite3 database. http://alt.textdrive.com/assets/public/Nanoki/IPLocation.100.zip (48.3 MB) Usage example: % sqlite3 IPLocation.db select location.start as start, location.end as end,

[sqlite] SQL question

2008-08-18 Thread Petite Abeille
Hello, Not specific to sqlite, but a rather generic SQL question... Given a set of ids, what would be the proper way to find the records containing all those ids? Specifically, given a 'document_token' table containing a document_id mapping to multiple token_id, how would one find the docume

[sqlite] create table if not exists & virtual table?

2008-08-26 Thread Petite Abeille
Hello, Is it possible to use 'if not exists' in conjunction with the creation DDL for a virtual table? For example: create table if not exists document( content text ) vs. create virtual table if not exists document using fts3( content text ) The first statement works as advertise, but the

[sqlite] FTS, snippet & Unicode?

2008-08-26 Thread Petite Abeille
Hello, % sqlite3 -version 3.5.9 FTS's snippet seems to truncate Unicode sequences at time. For example, given the following text: Motto: ძალა ერთობაშია (Georgian) "Strength is in Unity" FTS's snippet would return the extract bellow for 'Unity, Freedom, Work': “… ��ია (Georgian) "Strength

Re: [sqlite] create table if not exists & virtual table?

2008-08-27 Thread Petite Abeille
Hello, On Aug 26, 2008, at 11:34 PM, Dennis Cote wrote: > Petite Abeille wrote: >> >> Is it possible to use 'if not exists' in conjunction with the >> creation >> DDL for a virtual table? >> > > No, its not possible. > > The sy

Re: [sqlite] FTS, snippet & Unicode?

2008-08-27 Thread Petite Abeille
On Aug 27, 2008, at 4:52 AM, Alexandre Courbot wrote: > I know there is a patch at > http://www.sqlite.org/cvstrac/tktview?tn=3140,38 that is supposed to > improve Unicode support in FTS3. I suspect it to turn any Unicode > character into a token - however maybe you can use it as a basis to > imp

Re: [sqlite] create table if not exists & virtual table?

2008-08-30 Thread Petite Abeille
On Aug 28, 2008, at 11:39 PM, Scott Hess wrote: > There is already such a feature request at: > http://www.sqlite.org/cvstrac/tktview?tn=2604 > > I just added a patch there which, I believe, implements this. I'm > going to float it on sqlite-dev to see if I'm missing anything. Nice :) Hope to

[sqlite] [ANN] Nanoki & SQLite's FTS

2008-09-04 Thread Petite Abeille
Hello, Nanoki, a simple, elegant wiki engine implemented in Lua. http://alt.textdrive.com/nanoki/ Online demo: http://svr225.stepx.com:3388/search?q=chicago Nanoki incorporates SQLite excellent FTS module to provide full text search. Cheers, PA.

Re: [sqlite] fts search, quoting and sippet generation

2008-09-08 Thread Petite Abeille
On Sep 7, 2008, at 1:46 AM, Peter Hoffmann wrote: > 1) The first one is to strip out all tags before inserting new text > into the virtual table. I don't want to do this, because I have a pure > text interface too, where the tags in results won't hurt. Went down that road (i.e. stripping tags be

Re: [sqlite] SQLite syntax diagrams

2008-10-03 Thread Petite Abeille
On Oct 3, 2008, at 4:48 PM, D. Richard Hipp wrote: > http://www.sqlite.org/draft/syntaxdiagrams.html > http://www.sqlite.org/draft/lang.html > > Comments, criticism, and error reports are welcomed - particularly if > they are received in time to be addressed prior to the release of > 3.6.4, curre

Re: [sqlite] [Index] Listing 6001 after 601 and not after 801?

2008-10-05 Thread Petite Abeille
On Oct 5, 2008, at 3:59 PM, Gilles Ganault wrote: > Is there a trick in SQL that lets me do this? ORDER BY ASC won't do > this. order by to_char( account_id ) perhaps? -- PA. http://alt.textdrive.com/nanoki/ ___ sqlite-users mailing list sqlite-users

Re: [sqlite] CURRENT_DATE Behavior

2008-10-22 Thread Petite Abeille
On Oct 21, 2008, at 10:44 PM, jonwood wrote: > Given some of the comments here, one might wonder how those poor MS > SQL Server > folks are able to get anything working at all. ;-) Good point. Usually, "they" don't have anything working at all :)) Cheers, PA. -- http://alt.textdrive.com/nan

[sqlite] [ANN] Nanoki online demo

2008-12-14 Thread Petite Abeille
Hello, The online demo of Nanoki, a simple wiki engine implemented in Lua, has been updated to version 1.11: http://svr225.stepx.com:3388/a The demo sports content from the 2008/9 Wikipedia Selection, containing about 5500 articles, accessible through full text search, courtesy of SQLite e

Re: [sqlite] Temporary table performance

2008-12-15 Thread Petite Abeille
On Dec 15, 2008, at 8:31 PM, Ofir Neuman wrote: > What can I do in order to improve performance? take a look at pragma temp_store = memory http://www.sqlite.org/pragma.html#pragma_temp_store > Will it be better to delete the content of the table instead of > delete the table and recreate it?

Re: [sqlite] Techniques to delay writes to SQLite

2009-02-03 Thread Petite Abeille
On Feb 3, 2009, at 3:12 PM, Brandon, Nicholas (UK) wrote: > I'm open to other techniques particularly if they would be simpler to > implement and manage! Using a queue of DML statements sound very reasonable :) Nanoki [1] uses that technique when indexing text documents with fts3: (1) A reques

[sqlite] [ANN] IPLocation.db (20090201)

2009-02-05 Thread Petite Abeille
Hello, IPLocation.db provides access to MaxMind's GeoLite City data as a - rather hefty- SQLite3 database. http://alt.textdrive.com/assets/public/Nanoki/IPLocation.20090201.tar.bz2 (42.5 MB) Usage example: % sqlite3 IPLocation.db select location.start as start, location.e

Re: [sqlite] httpd server ???

2009-03-17 Thread Petite Abeille
On Mar 18, 2009, at 12:30 AM, Ken wrote: > Does anyone know of an embedded http server that can serve and/or > create pages from a sqlite database? Arguably, there is an embarrassment of choices: http://en.wikipedia.org/wiki/Comparison_of_lightweight_web_servers To add to the confusion, here

Re: [sqlite] any command to find last rowid in a table

2010-02-05 Thread Petite Abeille
On Feb 5, 2010, at 8:37 PM, Vasanta wrote: > I couldn't find, looklike lot of expert users here, throw me command quickly Help Vampires: A Spotter’s Guide http://slash7.com/2006/12/22/vampires/ ___ sqlite-users mailing list sqlite-users@sqlite.org htt

Re: [sqlite] Vertical -> Horizontal transformation

2010-09-29 Thread Petite Abeille
On Sep 29, 2010, at 7:05 PM, Simon Slavin wrote: > SQL (not just SQLite) is traditionally terribly bad at doing matrix > inversions. What do you want to use the wide short table for ? Does it > really need to exist as a table ? Just for fun (and profit): http://www.orafaq.com/wiki/PIVOT htt

Re: [sqlite] Tips on connecting to remote SQLite servers?

2010-09-30 Thread Petite Abeille
On Sep 30, 2010, at 11:40 PM, Mike wrote: > I am new to SQLite and I want to connect to a remote older SQLite server > from a modern iPhone app. > > I am using the C API to connect. Can someone tell me the syntax for > connecting to a remote SQLite server using the C API? http://www.sqlite.or

Re: [sqlite] Pivot Sequential Data into Dynamic Groups

2010-09-30 Thread Petite Abeille
On Sep 30, 2010, at 11:44 PM, Jordan Dahlke wrote: > Is there a good way to do this with Select and Group By statement? For a given definition of "good" :P create temporary table range as select 0 as start, 24 as end union all select 25 as start, 49 as end union all select 50 as start, 74 as

Re: [sqlite] Pivot Sequential Data into Dynamic Groups

2010-10-01 Thread Petite Abeille
On Oct 1, 2010, at 2:41 PM, Igor Tandetnik wrote: > Rather than hardcoding table range, you can synthesize it directly from > measurement. Something like this: Yes, very nice. That said, not all problems deserve sophisticated solutions. > Note also that 'end' and 'temp' are keywords in SQL, y

Re: [sqlite] Speed up DELETE of a lot of records

2010-10-07 Thread Petite Abeille
On Oct 7, 2010, at 6:05 PM, Michele Pradella wrote: > I have a DB of about 3GB: the DB has about 23 millions of records. [..] > the statement is trying to delete about 5 millions records and it takes > about 4-5minutes. > Is there a way to try to speed up the DELETE? Considering that you want t

Re: [sqlite] create View for four tables

2010-10-07 Thread Petite Abeille
On Oct 7, 2010, at 5:49 AM, Redhot wrote: > I need to pull information from 4 different tables. I read taht using the > "Create View" is that best way for this. Non sequitur :) > Can you let me now if my code is correct? http://en.wikipedia.org/wiki/Join_(SQL) __

Re: [sqlite] SQLite database sync

2010-10-07 Thread Petite Abeille
On Oct 6, 2010, at 5:50 PM, David Haymond wrote: > If I copy, I don't want to transfer EVERY record to the server each time I > sync, because that would be a waste of bandwidth. What is the best way to > copy only those records that have changed to the server? Perhaps you could simply rsync th

Re: [sqlite] SQLite database sync

2010-10-07 Thread Petite Abeille
On Oct 7, 2010, at 9:35 PM, Nicolas Williams wrote: > A general tool for hands-off bi-di synchronization of arbitrary DBs is > not really feasible, not in a way that would satisfy most users. Perhaps we should ask the author of diffkit [1] to solve that hairy problem for the rest of us :)) I

Re: [sqlite] Query hung. Any help. (sqlite & dbi)

2010-10-18 Thread Petite Abeille
On Oct 18, 2010, at 6:58 PM, Igor Tandetnik wrote: > In general, I found that the idiom > > TableA left join TableB on (TableA.idInTableB = TableB.someId) where > TableB.someId is null > > almost always performs worse than the equivalent NOT EXISTS or NOT IN query. Hmmm... in practice it shou

[sqlite] Constraint name?

2010-11-11 Thread Petite Abeille
Hello, Is there a way, short of parsing the original DDL, to retrieve a constraint name? For example, given: create table foo ( bar text, constraint foo_uk unique( bar ) ) How does one retrieve the unique constraint name, "foo_uk"? Thanks. Cheers, PA. __

Re: [sqlite] Question about SQLite features.

2010-11-11 Thread Petite Abeille
On Nov 11, 2010, at 8:30 PM, Olaf Schmidt wrote: > If such an "encapsulation of business-rules" is sitting in the > DB itself - written in a proprietary "DB-dialect", then you > cannot call such a thing a "business-layer" anymore. Nonsense :)) In any case, for these of us who do want to be clos

Re: [sqlite] Question about SQLite features.

2010-11-11 Thread Petite Abeille
On Nov 10, 2010, at 11:05 AM, Andy Gibbs wrote: >> That's I don't know SQLite have stored procedure support? >> > > How're your C skills? Or perhaps SQLite should embed Lua [1] as its powerful, fast, lightweight, scripting language and be done with it :) [1] http://www.lua.org/about.html __

Re: [sqlite] Question about SQLite features.

2010-11-11 Thread Petite Abeille
On Nov 12, 2010, at 12:31 AM, Jay A. Kreibich wrote: > There have been many proposals to do just this, and in specific, > with Lua. Outside of some moderate technical issues, the > big problem is the license. Something like that would *never* > be part of the SQLite core because the Lua lic

Re: [sqlite] Question about SQLite features.

2010-11-12 Thread Petite Abeille
On Nov 11, 2010, at 9:38 PM, Ian Hardingham wrote: > Haha! Sqlite is embedded by others. It NEVER embeds. SQLite's tagline of the week :P ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-user

Re: [sqlite] Constraint name?

2010-11-12 Thread Petite Abeille
On Nov 12, 2010, at 7:20 AM, Roger Binns wrote: >> A ticket that has been open on this topic since January 2006. > > Oops, forgot to paste: > > http://www.sqlite.org/src/tktview?name=23b2128201 Thanks for that. Since 2006? High priority indeed :) That said, maybe SQLite has reached a point w

Re: [sqlite] Constraint name?

2010-11-12 Thread Petite Abeille
On Nov 12, 2010, at 8:18 PM, Roger Binns wrote: > Your definition of "proper" appears to be some ISO standard :-) Nah, not specially fond of that ISO standard, more for illustration purpose really. > SQLite's approach is certainly acceptable to most (evidence: if not > there would be a lot of

Re: [sqlite] Simple SQL question?

2010-11-16 Thread Petite Abeille
On Nov 16, 2010, at 11:55 PM, Bart Smissaert wrote: > This seems to work fine, Then you are golden :) > but I am not sure if this SQL is correct and > if the results will always be correct and have a feeling > that there must be a better construction. > Any suggestions? Nothing very meaning

[sqlite] joining two sequences?

2010-11-19 Thread Petite Abeille
Hello, Given two tables describing sequences of key value pairs, what would be a reasonable way to join them? For example, assuming two table foo and bar with identical structure: create temporary table foo ( key integer not null, value text not null, constraint foo_

Re: [sqlite] FTS3 snippets() grouping

2010-11-19 Thread Petite Abeille
On Nov 19, 2010, at 9:46 PM, Matthew Leffler wrote: > A question: Is is possible to group the data from the snippets() column in a > result? The query would look something like the following (which doesn't > work): > >>> SELECT snippet(search, '', '', '...') as extract, count() as count FROM

Re: [sqlite] FTS3 snippets() grouping

2010-11-19 Thread Petite Abeille
On Nov 19, 2010, at 10:14 PM, Matthew Leffler wrote: > I thought of that but I get an error with that query: > >>> unable to use function snippet in the requested context > Pesky function :P Then, if everything else fails, you could write it down in a temp table, and group that sigh...

Re: [sqlite] Queries on PRAGMA table_info()

2010-11-22 Thread Petite Abeille
On Nov 22, 2010, at 7:26 PM, Simon Slavin wrote: >> PRAGMA table_info(my_table) returns a row for each column in my_table. Is >> it possible to do selects on this result set? > > Nope. The PRAGMA command does not present data to the SQL engine, it returns > results directly. Grab the whole

Re: [sqlite] joining two sequences?

2010-11-22 Thread Petite Abeille
Hi Jim, On Nov 20, 2010, at 6:52 PM, Jim Morris wrote: >> This should return a the equivalent keys in the two maps. The basic >> idea is to compare the values in each key in foo(left outer join foo) >> with the values for each key in bar where there are any matching >> values(left outer join bar

Re: [sqlite] Queries on PRAGMA table_info() [superview]

2010-11-22 Thread Petite Abeille
On Nov 22, 2010, at 10:09 PM, Jay A. Kreibich wrote: > Below is code for the "superview" virtual table module. It allows > *any* SQL statement to be turned into a read-only virtual table-- > including PRAGMA statements. Oh... very nice... thanks for sharing :) __

[sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-08 Thread Petite Abeille
Hello, The pragma foreign_key_list appears to be deprecated in 3.7.4: http://www.sqlite.org/pragma.html#pragma_foreign_key_list Any reason for such deprecation? What's the alternative to that pragma to achieve the same effect? Thanks in advance. __

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-08 Thread Petite Abeille
On Dec 8, 2010, at 8:44 PM, Richard Hipp wrote: > Now that foreign key constraints are enforced natively, why would you want > to have a list of them? To know what they are. In the same way as there are pragma that list database, table, column, index, etc... To paraphrase: "Now that tables a

Re: [sqlite] pragma foreign_key_list deprecated in 3.7.4?

2010-12-10 Thread Petite Abeille
On Dec 10, 2010, at 12:17 PM, Richard Hipp wrote: > I relented on this two days ago. See > http://www.sqlite.org/docsrc/info/d399230aae for the check-in. Version > 3.7.5 will list PRAGMA foreign_key_list as fully supported. (sigh) Much excellent. Thanks :) ___

Re: [sqlite] pragma foreign_key_list

2010-12-10 Thread Petite Abeille
On Dec 11, 2010, at 2:29 AM, Simon Slavin wrote: > Then all the other PRAGMAs that do this could be removed While a consistent, comprehensive API would be nice, the problem with pragmas is that, even though they return what looks like a result set, they are neither selectable, nor queryable in

Re: [sqlite] pragma vs select for introspection

2010-12-11 Thread Petite Abeille
On Dec 11, 2010, at 3:48 PM, Simon Slavin wrote: > Section 21 of the (SQL92) standard. Yes, the notorious information schema: http://en.wikipedia.org/wiki/Information_schema > It's absolutely horrible. Des goûts et des couleurs on ne discute point. > Let's try to avoid that if we can. Well,

Re: [sqlite] pragma vs select for introspection

2010-12-12 Thread Petite Abeille
On Dec 12, 2010, at 1:29 AM, Darren Duncan wrote: >> On Dec 11, 2010, at 3:48 PM, Simon Slavin wrote: >> >>> Section 21 of the (SQL92) standard. >> >> Yes, the notorious information schema: > > Nonsense. An information schema is a *good* thing, and is generally the > *best* > tool for intro

Re: [sqlite] pragma vs select for introspection

2010-12-14 Thread Petite Abeille
On Dec 14, 2010, at 5:26 PM, Wols Lists wrote: > Exactly the sort of answer I was afraid of ... but I think my answer is > going to horrify you as much as yours horrified me. "... he began yawning and looking at his watch..." ___ sqlite-users mailing

Re: [sqlite] SQLite server

2010-12-21 Thread Petite Abeille
On Dec 21, 2010, at 2:44 PM, Philip Graham Willoughby wrote: > It should be significantly easier to define a new storage engine for MySQL > that uses the SQLite data format for its tables. While we are on the subject... http://dev.mysql.com/tech-resources/articles/dbixmyserver.html TL;DR: use

Re: [sqlite] Getting a table's field labels with Perl, DBI

2011-01-26 Thread Petite Abeille
On Jan 26, 2011, at 11:04 AM, BareFeetWare wrote: > Yes, it is very unfortunate that INFORMATION_SCHEMA or similar is not > provided by SQLite, Agree, SQLite is seriously lacking in that domain :/ > a topic that keeps recurring here in one form or another. Eh! > Yu currently have to do your

Re: [sqlite] SQLite version 3.7.5

2011-02-01 Thread Petite Abeille
On Feb 1, 2011, at 2:32 AM, Richard Hipp wrote: > performance is improved over the previous release by 1% or 2%. Hmmm... under 3.7.3, a little process of mine was handling around 52M records (~3GB) in about 113 minutes... now, with 3.7.5, the same process, running on the same machine, under th

Re: [sqlite] Trigger for incrementing a column is slow

2011-02-03 Thread Petite Abeille
On Feb 3, 2011, at 6:53 PM, Kevin Wojniak wrote: > The trigger is ran once via sqlite3_exec(); Hmm... you mean the trigger is run every single time you perform an insert, no? > Any insight as to why the trigger is significantly slower? It adds significant overhead for each and every insert. >

Re: [sqlite] Speed up count(distinct col)

2011-02-07 Thread Petite Abeille
On Feb 7, 2011, at 4:26 PM, Yuzem wrote: > > I have many movies by tag and many tables like "tags" (keywords, countries, > languages, genres, etc..) Hey... sounds like IMdb :P > This solution implies one additional table and two triggers by each table. To paraphrase: Some people, when confro

Re: [sqlite] Speed up count(distinct col)

2011-02-07 Thread Petite Abeille
On Feb 7, 2011, at 9:32 PM, Yuzem wrote: >> Hey... sounds like IMdb :P >> > Yes, I'm coding a http://yuzem.blogspot.com/p/figuritas-screenshots.html > movie manager that grabs the info from imdb. A fine hobby :) > I thought sqlite didn't handle foreign keys correctly, I thought wrong :) ht

Re: [sqlite] Feature Request: PRAGMA foreign_key_list(tableName) should display the name of the foreign key constraint

2011-02-08 Thread Petite Abeille
On Feb 8, 2011, at 9:07 PM, Rami Abughazaleh wrote: > I would like to request that "PRAGMA foreign_key_list(tableName)" display > the name of the foreign key constraint. Seconded! :) Unfortunately this doesn't seem to be a priority: http://www.mail-archive.com/sqlite-users@sqlite.org/msg56395.

Re: [sqlite] Speed up count(distinct col)

2011-02-10 Thread Petite Abeille
On Feb 10, 2011, at 5:00 PM, Yuzem wrote: > The only thing I can think of is to have additional tables for the ids of > all directors, all writers, etc... > Tables "movies", "people", "capacity" and then tables "directors", > "writers", etc.. with only the IDs so I can count using count(*) which

Re: [sqlite] SQLite server using execnet ?

2011-02-21 Thread Petite Abeille
On Feb 21, 2011, at 9:37 PM, Jay A. Kreibich wrote: > I was once forced to look at SOAP over SMTP Ah, yes... double S! The S stands for Simple http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/ ___ sqlite-users mailing li

Re: [sqlite] Indexing - a test example

2011-03-07 Thread Petite Abeille
On Mar 7, 2011, at 1:58 PM, Richard Hipp wrote: > The beauty of SQL (not just SQLite but any SQL database engine) is that you > can focus on the semantics of your query and not worry about the > implementation - the SQL database engine will figure out the best query > algorithm for you. Ah, yes

Re: [sqlite] Comparing Value of a Table and creating a Delta Report

2011-03-15 Thread Petite Abeille
On Mar 15, 2011, at 7:29 PM, Ralf Jantschek wrote: > I have to compare entries with status=0 to status=1 and find out the > differences in name, value fields. Tangentially related: "DiffKit is like the Unix diff utility, but for tables instead of lines of text" http://www.diffkit.org/

Re: [sqlite] SQLite IDE's

2011-03-22 Thread Petite Abeille
On Mar 22, 2011, at 7:46 PM, Sam Carleton wrote: > The one feature I don't see is a tool that can do a diff on the DDL of two > SQLite db's. Ah, yes, something along the lines of Oracle's DBMS_METADATA_DIFF.COMPARE_ALTER [1] would be handy. Alternatively, what about a simple DIFF(1) between t

  1   2   3   4   5   6   7   >