Re: [sqlite] LEFT JOIN: ON vs. WHERE

2019-10-29 Thread Allen, Marc
ws the database to not even bother doing the lookup on S if R.col != 'foo' and still return that R record. Marc Marc L. Allen | Software Engineer IV, PDI Marketing Cloud Solutions 2551 Eltham Ave. Suite N, Norfolk, VA 23513 Office 757.853.3000 x6015 Direct 757.605.6015 mlal...@pdisoftwa

[sqlite] missed optimization in view queries

2019-05-19 Thread Marc Espie
I'm working on a somewhat large database where sqlite is apparently missing an optimization in its query planner. I've attached a simple schema to reproduce the issue. The problem lies with the ports view. It does grab data from some other tables using left join, and also some aggregated data fro

[sqlite] Email bounce

2019-02-05 Thread Marc L. Allen
when it’s done. Thanks Marc Confidentiality notice: This e-mail is intended solely for use of the individual or entity to which it is addressed and may contain information that is proprietary, privileged, company confidential and/or exempt from disclosure under applicable law. If the reader

Re: [sqlite] Index help...

2018-10-23 Thread Marc L. Allen
I’m not the expert here, but it appears that the cause is that your looking for things greater than some confidence. This forces an index scan. There’s nothing that gives a list of different confidences greater than, in this case .8, but even if it did, an index scan might be faster than individ

Re: [sqlite] unsubscribe

2018-10-23 Thread Marc L. Allen
Because it knows you don't really want to leave. -Original Message- From: sqlite-users On Behalf Of Rob Dixon Sent: Tuesday, October 23, 2018 12:41 PM To: SQLite mailing list Subject: Re: [sqlite] unsubscribe I did that yesterday 3 times, got 3 confirmations and yet.. On Tue, Oct 23,

Re: [sqlite] Can this be done with SQLite

2018-01-22 Thread Marc L. Allen
from the start or end of the cycle. Marc -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Cecil Westerhof Sent: Monday, January 22, 2018 4:37 PM To: SQLite mailing list Subject: Re: [sqlite] Can this be done with SQLite 2018-01-22

Re: [sqlite] Is this a bug with expression evaluation?

2017-12-14 Thread Marc L. Allen
I just multiply by 1.0 Select column1*(column2 * 1.0 / column3)... Removing the parentheses only provide the correct results in your example. It's still using integer math, it's just performing the multiply first, as per order of operations. -Original Message- From: sqlite-users [mail

Re: [sqlite] finding the number of records until a value is different

2017-12-07 Thread Marc L. Allen
ay, and you'll need to modify it based on size of table and available indexes. I think the above should work fairly well if you have indexes on both the row_number and bc. Marc -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of ni

Re: [sqlite] 3.18.0 SELECT..WHERE x & ? != 0; doesn't use an index

2017-07-14 Thread Marc L. Allen
more efficient that the other. I didn't realize (or had forgotten) that integers could be stored with variable length. Naturally, that has additional impact. > On Jul 14, 2017, at 9:37 PM, Keith Medcalf wrote: > > On Friday, 14 July, 2017 18:20, Marc L. Allen > said: >

Re: [sqlite] 3.18.0 SELECT..WHERE x & ? != 0; doesn't use an index

2017-07-14 Thread Marc L. Allen
hat the where condition > does not match all rows. > > -- > ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı > >> -Original Message- >> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] >> On Behalf Of Marc L. Allen >>

Re: [sqlite] 3.18.0 SELECT..WHERE x & ? != 0; doesn't use an index

2017-07-14 Thread Marc L. Allen
But, what's the equivalent of y & 2 != 0? That converts to y IN (0, 2, 4, ... MAX(y) & 2) Ignoring the MAX(y), that's just a series of multiple indexed lookups and a table scan is almost certainly more efficient. Marc > On Jul 14, 2017, at 1:55 PM, Howard Kapustein > w

Re: [sqlite] Version 3.20.0 coming soon...

2017-07-13 Thread Marc L. Allen
at into account for internal performance optimizations. At present the only optimization is to avoid using lookaside... etc. Marc -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Thursday, July 13, 2017 4:2

Re: [sqlite] Column alignment wrong when using multibytr characters

2017-05-06 Thread Marc Baudoin
Richard Hipp écrit : > On 5/5/17, Marc Baudoin wrote: > > > > I've encountered a problem with SQLite version 3.18.0 about how > > it handles multibyte characters. > > Thanks for the bug report. > > That problem was fixed about 19 days ago with the ch

[sqlite] Column alignment wrong when using multibytr characters

2017-05-06 Thread Marc Baudoin
Hi, I've encountered a problem with SQLite version 3.18.0 about how it handles multibyte characters. Consider this table: CREATE TABLE film ( id INTEGER PRIMARY KEY , titre VARCHAR ( 50 ) NOT NULL , sortie DATENOT NULL ) ; filled with these d

Re: [sqlite] Reducing the output of a query

2017-05-02 Thread Marc L. Allen
Assuming each column is either NULL or a distinct item for each group, just use MAX() of each column adding the necessary group bys. -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Joseph L. Casale Sent: Tuesday, May 2, 2017 3:55

Re: [sqlite] Problem compiling 3.17.0 in MSVS 12

2017-02-14 Thread Marc L. Allen
This is a total shot in the dark... but something with line endings (\r, \n, \r\n, etc.) messing up the #define blah \ Or other things? -Original Message- From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Drago, William @ CSG - NARDA-MITEQ Sent: Tues

Re: [sqlite] Query Planner fails to recognise efficient strategy when '=' condition gives a strong hint

2016-11-17 Thread Marc L. Allen
Planner fails to recognise efficient strategy when '=' condition gives a strong hint On 11/17/16, Marc L. Allen wrote: > I'm not sure that's a valid trick, as bar.foo can be NULL, in which > case the LEFT join still returns it, but an INNER join does not. > Unles

Re: [sqlite] Query Planner fails to recognise efficient strategy when '=' condition gives a strong hint

2016-11-17 Thread Marc L. Allen
Behalf Of Richard Hipp Sent: Thursday, November 17, 2016 9:32 AM To: SQLite mailing list Subject: Re: [sqlite] Query Planner fails to recognise efficient strategy when '=' condition gives a strong hint On 11/17/16, Marc L. Allen wrote: > Maybe I'm missing something, but... > &

Re: [sqlite] Query Planner fails to recognise efficient strategy when '=' condition gives a strong hint

2016-11-17 Thread Marc L. Allen
Maybe I'm missing something, but... ORDER BY id Is ordering by the ID the right-hand side of a LEFT join. As such, it depends on how NULL factors into an ORDER BY. If NULL comes first, it has to find enough records where the LEFT join fails. Yeah.. I'm probably missing something. -Orig

[sqlite] Illegal SQL not rejected

2016-04-29 Thread Marc L. Allen
ehalf Of Igor Korot Sent: Friday, April 29, 2016 2:24 PM To: SQLite mailing list Subject: Re: [sqlite] Illegal SQL not rejected Marc, On Fri, Apr 29, 2016 at 1:50 PM, Marc L. Allen wrote: > That error is saying that you can't using HAVING on a column unless > it's in a group by

[sqlite] Illegal SQL not rejected

2016-04-29 Thread Marc L. Allen
That error is saying that you can't using HAVING on a column unless it's in a group by or it's referenced in an aggregate in the HAVING clause You could say, HAVING SUM(A) <> 0 or something. The query as stated SELECT SUM(A) ... HAVING A<>0 makes no sense because A is not in the select list.

[sqlite] Article about pointer abuse in SQLite

2016-03-24 Thread Marc L. Allen
With everything that routine does, the extra initialization negatively impacts operation? -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Thursday, March 24, 2016 10:50 AM To: S

[sqlite] Article about pointer abuse in SQLite

2016-03-22 Thread Marc L. Allen
I don't think compilers "run" your code. When looking for uninitialized variables, it simply looks for a potential path through the code that uses a variable without it being initialized. The fact that the code never actually allows that path to occur is beyond the scope of most compilers, isn

[sqlite] Article about pointer abuse in SQLite

2016-03-18 Thread Marc L. Allen
I had a long response to this, but it occurs to me that you're just being pedantic for fun. Am I wrong? -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Keith Medcalf Sent: Friday, March 18, 2016

[sqlite] SQLite Pronunciation

2016-03-16 Thread Marc L. Allen
m, why the fuss? To me, it falls off the tongue easier to say Sequel instead of Ess-Queue-Ell. 1- http://acronyms.thefreedictionary.com/RADAR On Wed, Mar 16, 2016 at 2:55 PM, Marc L. Allen wrote: > That sounds like someone that comes from the land of Sequel. ;) > > I realize there *

[sqlite] SQLite Pronunciation

2016-03-16 Thread Marc L. Allen
That sounds like someone that comes from the land of Sequel. ;) I realize there *is* an official pronunciation, but I will probably forever pronounce it as S-Q-L-light, regardless of what it really is. :) -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:s

[sqlite] i think this is a bug in sqlite? thanks

2015-12-10 Thread Marc L. Allen
I was about the suggest the same thing that was suggest in that thread. Verify the types of those values. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Anthony Damico Sent: Thursday, December

[sqlite] Alexa has been banished. Was: Mailing list policy change

2015-10-29 Thread Marc L. Allen
I save one. I can forward it to you, if you'd like. > On Oct 29, 2015, at 5:37 PM, Nicolas J?ger wrote: > > damn! I wanted a date! > >>> On 10/29/15, Simon Slavin wrote: >>> >>> You don't even need to mess with the genuine list server. Just grab all the >>> addresses it sends to and use ano

[sqlite] Simple Math Question

2015-10-23 Thread Marc L. Allen
I didn't see this go through, so I'm sending it again. I got an Alexa spam, so maybe that's part of it. I ran the following code on my ARM processor: double c25 = 0.0; c25 += 9.2; c25 += 7.9; c25 += 0.0; c25 += 4.0; c25 += 2.6; c25 += 1.3; double n25 = 25.0; double c23 = 0.0; c23 +=

[sqlite] Simple Math Question

2015-10-23 Thread Marc L. Allen
I ram the following code on my ARM processor: double c25 = 0.0; c25 += 9.2; c25 += 7.9; c25 += 0.0; c25 += 4.0; c25 += 2.6; c25 += 1.3; double n25 = 25.0; double c23 = 0.0; c23 += 9.2; c23 += 7.8; c23 += 0.0; c23 += 3.0; c23 += 1.3; c23 += 1.7; double n23 = 23.0;

[sqlite] Simple Math Question

2015-10-22 Thread Marc L. Allen
If I recall, he had a printout of the state at each time unit. The state was represented as a set of numbers out to 6 decimal points. He wanted to rerun part of the simulation, so he entered in those super-precise numbers and let them run, but the model quick diverged because those numbers jus

[sqlite] [sqlite-dev] Proposed new version numbering scheme for SQLite - Feedback requested

2015-10-08 Thread Marc L. Allen
SQLite Database Subject: Re: [sqlite] [sqlite-dev] Proposed new version numbering scheme for SQLite - Feedback requested On 10/8/15, Marc L. Allen wrote: > However, CTE is a functionality enhancement that, I believe, does not > impact the ability of previous SQLite versions to work wi

[sqlite] [sqlite-dev] Proposed new version numbering scheme for SQLite - Feedback requested

2015-10-08 Thread Marc L. Allen
as the new Query Analyzer done a few years back (which was a huge boost in performance) would be relegated to a Z change, which makes me sad. ;) -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Marc

[sqlite] [sqlite-dev] Proposed new version numbering scheme for SQLite - Feedback requested

2015-10-08 Thread Marc L. Allen
Just my $0.02... In the proposed new versioning system: Partial Indexes is clearly something that requires Y to be incremented as Y-1 won't be able to handle a database with partial indexes. However, CTE is a functionality enhancement that, I believe, does not impact the ability of previous SQ

[sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines

2015-07-27 Thread Marc L. Allen
te.org] On Behalf Of Reinhard Max Sent: Monday, July 27, 2015 12:04 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines On Mon, 27 Jul 2015 at 17:48, Marc L. Allen wrote: > When would that speci

[sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines

2015-07-27 Thread Marc L. Allen
other machines On Mon, 27 Jul 2015 at 17:34, Marc L. Allen wrote: > Sorry.. confused does sqlite allow comparison between NULLs? No. > LEFT JOIN work ON work.fpath = home.fpath WHERE work.fpath IS NULL > > Should never match anything... it checks to see if work.fpath IS NULL

[sqlite] Query takes 8 seconds on one machine but I abort after 40+ minutes on other machines

2015-07-27 Thread Marc L. Allen
I'm missing something stupid, so massive apologies in advance. Maybe I came in late and this is some clever way of using an index? Marc -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of

[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-18 Thread Marc L. Allen
nd when people try to use it to do real work. Regards David M Bennett FACS Andl - A New Database Language - andl.org -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Marc L. Allen Sent: Thursday,

[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-18 Thread Marc L. Allen
. *this* exists.. try it." Heck, maybe Andl does it. I haven't looked. Marc -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-bounces at mailinglists.sqlite.org] On Behalf Of da...@andl.org Sent: Thursday, June 18, 2015 6:36 AM To:

[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-16 Thread Marc L. Allen
I don't know. Back in the day, assembly was low-level because it was directly converted to machine code. C was high level because you could express more complex structures without worrying about the underlying architecture. I still like that distinction. I think people are trying to call C low

[sqlite] Mozilla wiki 'avoid SQLite'

2015-06-15 Thread Marc L. Allen
Perhaps you might want to consider an apology and check your headers next time. I'm pretty sure the comment you quoted from this morning was written by Scott Doctor, not Scott Robinson. -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...

[sqlite] saving :memory:database to disk

2015-05-07 Thread Marc L. Allen
Don't you already have to have a DB initialization script to create the in-memory database? Couldn't you use that to create the on-disk database, and then have a separate script to copy all the data over? Or is this for more of a dynamic database whereby the users can add/remove tables and ind

Re: [sqlite] Select count(*)

2014-12-11 Thread Marc L. Allen
I believe that when NULLs are allowed as PKs, they are all distinct. So, you can multiple rows with a NULL value as the PK. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dominique Devienne Sent: Thursday, December 11, 2014

Re: [sqlite] sqlite bugreport : unique index causes valid updates to fail

2014-12-08 Thread Marc L. Allen
Doesn't that code risk being broken in a later version that doesn't update in the order provided by the sub-query? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of J T Sent: Monday, December 08, 2014 9:23 AM To: rsm...@rsweb.c

Re: [sqlite] sqlite bugreport : unique index causes valid updates to fail

2014-12-08 Thread Marc L. Allen
it. When making a 'lite' version of something, it's normal to eliminate difficult or intensive features that can be lived without. I think this is one of them. Marc -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On B

Re: [sqlite] sqlite bugreport : unique index causes valid updates to fail

2014-12-08 Thread Marc L. Allen
I am like you, Gwendal, in that I don't like that behavior in SQLite; however, not liking it doesn't make it a bug. The constraint-checking algorithm was defined to work exactly the way it's working. When designed, the fact that your type of insert would fail was known and understood. Hence,

Re: [sqlite] insert or ignore with foreign keys

2014-11-25 Thread Marc L. Allen
rror where, INSERT INTO t2 VALUES (1,1) INSERT INTO t2 VALUES (1,1) Would. As for the best way to do what you want, I'm not sure. Obviously, you could precheck the foreign key yourself, but I suspect your actual code is more sophisticated. Marc -Original Message- From: sq

Re: [sqlite] Bug

2014-11-19 Thread Marc L. Allen
I think attachments are dropped. If the SQL is reasonable size, just post it. Otherwise, you'll need to host the screen shot somewhere and link to it. > On Nov 19, 2014, at 10:00 PM, Josef Handsuch wrote: > > Dear developer, I'd like to thank you for you brilliant software. There > just seem

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Marc L. Allen
ight. Yes, SQLite accepts queries that go against SQL standard. Yes, if your query is formatted correctly, it executes correctly, so the fact that it takes a non-standard query is still an error on the programmer's part, even if SQLite didn't flag it. At least it does have rul

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Marc L. Allen
Really? Interesting. So... Select 1 Where 1 < inf; ? Or is it just when taking inf by itself? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp Sent: Monday, May 05, 2014 11:32 AM To: General Discussion of SQLi

Re: [sqlite] Bug in division?

2014-04-30 Thread Marc L. Allen
Not an error. Int/Int uses integer division and results in an integer number. When one number is a float, the result becomes a float. I don't know about all SQL varieties, but MSSQL is the same. > On Apr 30, 2014, at 8:04 AM, "Gene Connor" wrote: > > > SELECT DISTINCT 2/4 AS RESULT FROM TAB

Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement

2013-09-24 Thread Marc L. Allen
eille Sent: Tuesday, September 24, 2013 2:14 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement On Sep 24, 2013, at 8:09 PM, Marc L. Allen wrote: > Not complaining, mind you. MS SQL doesn't have it, and I've

Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement

2013-09-24 Thread Marc L. Allen
RT OR REPLACE" statement On 24 Sep 2013, at 7:09pm, Marc L. Allen wrote: > Also, there are times when you do a bulk insert, so you have to structure the > query to not fail on records that are already present. Yeah. Actually I got what I posted wrong. I should have written Which is why

Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement

2013-09-24 Thread Marc L. Allen
PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement On 24 Sep 2013, at 6:58pm, Petite Abeille wrote: > On Sep 24, 2013, at 7:54 PM, "Marc L. Allen" > wrote: > >> Yep. What most people want is

Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement

2013-09-24 Thread Marc L. Allen
on of SQLite Database Subject: Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement On Sep 24, 2013, at 7:54 PM, "Marc L. Allen" wrote: > Yep. What most people want is an INSERT OR UPDATE. Yep. Which is what one usually calls 'MERGE': http://en.wik

Re: [sqlite] Bug : Tcl interface + "INSERT OR REPLACE" statement

2013-09-24 Thread Marc L. Allen
Yep. What most people want is an INSERT OR UPDATE. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Petite Abeille Sent: Tuesday, September 24, 2013 1:48 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Bug

Re: [sqlite] Hints for the query planner

2013-09-10 Thread Marc L. Allen
As I was reading this, I said to myself, "what they really need is a confidence value." Then I read the end and, there it was! A confidence value. Ok.. not exactly confidence, but I think you get my meaning. It seems to me that you're allowing the query writer to substitute personal knowledg

Re: [sqlite] UPDATE question

2013-09-07 Thread Marc L. Allen
Yes, thanks. I was mistaken. On Sep 6, 2013, at 9:27 PM, "James K. Lowden" wrote: > On Fri, 6 Sep 2013 07:56:53 -0500 > "Marc L. Allen" wrote: > >> I don't think it's a bug. > > It is a bug as long as the behavior is in exception to the

Re: [sqlite] UPDATE question

2013-09-06 Thread Marc L. Allen
MySQL also uses this implementation. They acknowledge that it is not SQL compliant and that (I never thought of this), you cannot delete a record that has a foreign key link to itself. Postgres apparently has the ability to have deferred checking as of V9, but not before then. Please see: ht

Re: [sqlite] UPDATE question

2013-09-06 Thread Marc L. Allen
Nice, but that still requires extra work. 1) Determine if row is already in table. 2) Determine next lower value. 3) Split difference and insert. There's also the possibility that the higher level APP expects the new row to have a sequence number of 3. -Original Message- From: sqlite-us

Re: [sqlite] UPDATE question

2013-09-06 Thread Marc L. Allen
I don't think it's a bug. I don't believe there's any defined rule for how SQL should behave, is there? The updates are done serially not atomically. If the rows happen to be processed in reverse order, then no constraint is violated. In fact, if there was a way to define the order the updat

Re: [sqlite] UPDATE question

2013-09-06 Thread Marc L. Allen
-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Dominique Devienne Sent: Friday, September 06, 2013 3:28 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] UPDATE question On Fri, Sep 6, 2013 at 6:21 AM, James K. Lowden wrote: > Here's how Ma

Re: [sqlite] UPDATE question

2013-09-05 Thread Marc L. Allen
Oops.. sorry.. I missed the last paragraph. If you're essentially single threaded.. I can do it in two updates... UPDATE table SET Sequence = -(Sequence + 1) WHERE Sequence >= seq_to_insert AND Name = name_to_insert UPDATE table SET Sequence = -Sequence WHERE Sequence < 0 AND Name = name_to_

Re: [sqlite] UPDATE question

2013-09-05 Thread Marc L. Allen
How about... ? UPDATE table SET Sequence = Sequence + 1 WHERE Sequence >= seq_to_insert AND Name = name_to_insert -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Peter Haworth Sent: Thursday, September 05, 2013 2:21 PM To: s

Re: [sqlite] Collating sequences. Was: Query problems

2013-09-05 Thread Marc L. Allen
The left-most of the first select? Or the second? Maybe I don't understand 'left-most?' -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp Sent: Thursday, September 05, 2013 9:36 AM To: General Discussion of SQLit

Re: [sqlite] Table name length in sqlite affects performance. Why?

2013-09-04 Thread Marc L. Allen
Not to mention having to check each new table to see if it's already in the database and the associated physical reads that might be associated with that. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Jay A. Kreibich Sent:

Re: [sqlite] Inefficient covering index used for Subversion with SQLite 3.8.0

2013-09-03 Thread Marc L. Allen
Am I understanding that, in this example, the I_NODES_PARENT is being chosen as the search index because... it's smaller and therefore faster to find initial qualifying rows that you can then use in some sort of ordered lookup in another index/table? I'm always in awe of some of the plans a goo

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Marc L. Allen
Database Subject: Re: [sqlite] segmentation fault with 3.8.0 On Thu, Aug 29, 2013 at 11:47 AM, Marc L. Allen wrote: > Silly question.. I looked at the fix. Why ignore indexes with greater > than 4 fields? Isn't that a bit risky? Wouldn't it be better to > ignore the fields af

Re: [sqlite] segmentation fault with 3.8.0

2013-08-29 Thread Marc L. Allen
Silly question.. I looked at the fix. Why ignore indexes with greater than 4 fields? Isn't that a bit risky? Wouldn't it be better to ignore the fields after the 4th one for planning? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] O

Re: [sqlite] Different result from experimental query

2013-08-28 Thread Marc L. Allen
Looks like that should return one row, yes? I wonder if operator precedence is broken for that query and the OR is binding higher than the AND. Also possible is that the NOT NULL for id in table t is messing up some query optimization with t2.id NOT NULL. -Original Message- From: sqli

Re: [sqlite] name resolutionn in GROUP BY

2013-08-15 Thread Marc L. Allen
n Wed, 14 Aug 2013 14:57:19 -0500 "Marc L. Allen" wrote: > I'd actually like a compromise. Allow GROUP BY to accept a derived > name if no base name exists. I realize that's against spec, but > there's no ambiguity (as it otherwise errors out), It would also m

Re: [sqlite] name resolutionn in GROUP BY

2013-08-14 Thread Marc L. Allen
I'd actually like a compromise. Allow GROUP BY to accept a derived name if no base name exists. I realize that's against spec, but there's no ambiguity (as it otherwise errors out), and does make it much nicer when the derived column is a hairy expression that I end up needing to replicate in

Re: [sqlite] name resolution in GROUP BY

2013-08-14 Thread Marc L. Allen
Peter, I'm sorry.. you're correct. I missed that. Marc -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Peter Aronson Sent: Wednesday, August 14, 2013 2:53 PM To: General Discussion of SQLite Database Subject: R

Re: [sqlite] name resolutionn in GROUP BY

2013-08-14 Thread Marc L. Allen
This appears to be how MS SQL handles it... looking at the definitions below, MS SQL uses the base value in GROUP BY and the derived value in ORDER BY. That said, 'lower(m)' referenced the base m, not the derived m in the ORDER BY. I'm afraid I don't understand enough about COLLATE to get why

Re: [sqlite] name resolution in GROUP BY

2013-08-14 Thread Marc L. Allen
013 2:26 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] name resolution in GROUP BY On Wed, Aug 14, 2013 at 2:18 PM, Marc L. Allen wrote: > Heh... I forgot.. both selects below are identical, as 'lower(m1)' is > incorrect. MS SQL does not permit further operat

Re: [sqlite] name resolution in GROUP BY

2013-08-14 Thread Marc L. Allen
] On Behalf Of Richard Hipp Sent: Wednesday, August 14, 2013 2:26 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] name resolution in GROUP BY On Wed, Aug 14, 2013 at 2:18 PM, Marc L. Allen wrote: > Heh... I forgot.. both selects below are identical, as 'lower

Re: [sqlite] name resolution in GROUP BY

2013-08-14 Thread Marc L. Allen
Heh... I forgot.. both selects below are identical, as 'lower(m1)' is incorrect. MS SQL does not permit further operations on the derived value. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marc L. Allen Sent:

Re: [sqlite] name resolution in GROUP BY

2013-08-14 Thread Marc L. Allen
I seem to recall having read that as well. I believe, however, that MySQL does allow it, but I think it defaults to base table when available. Also, a modified form of the test case: DROP TABLE #t1 CREATE TABLE #t1(m VARCHAR(4)); INSERT INTO #t1 VALUES('az'); INSERT INTO #t1 VALUES('by'); INSE

Re: [sqlite] name resolutionn in GROUP BY

2013-08-14 Thread Marc L. Allen
As does MS SQL 2008 R2 DROP TABLE #Test CREATE TABLE #Test ( Val int ) INSERT INTO [#Test] ([Val]) VALUES (-2), (2) SELECT Val FROM #Test GROUP BY Val SELECT ABS(Val) AS Val FROM #Test GROUP BY Val Val --- -2 2 Val --- 2 2 Your requested test case: Untitled1 m - - 1 x 1

Re: [sqlite] attaching databases programmatically

2013-07-22 Thread Marc L. Allen
Perhaps I misunderstood the question. It sounds like he has the sqlite* objects for the databases, but wants to be able to determine the database/filename associated with them so he can construct an ATTACH statement in another query. So.. the question is.. given an sqlite*, can you determine t

Re: [sqlite] attaching databases programmatically

2013-07-22 Thread Marc L. Allen
, July 22, 2013 10:51 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] attaching databases programmatically Marc L. Allen wrote on Monday, July 22, 2013 10:47 AM > Nelson, Erik wrote: > > I've got an application that allows the user to create an arbitrary > >

Re: [sqlite] Is pragma foreign_key_check fast enough to be used in normal application flow?

2013-05-24 Thread Marc L. Allen
It's exhaustive in that it absolutely verifies if the key exists or not. However, it doesn't necessarily do a full database scan. I assume it uses available indexes and does a standard lookup on the key. So, it still might be fast enough for what you want (though I missed the beginning of the

Re: [sqlite] SQLite NULL or 0-Length

2013-05-23 Thread Marc L. Allen
No. All SQL functions can safely take NULL as an argument. LENGTH(NULL) returns NULL, so LENGTH(NULL) = 0 is always false. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rob Richardson Sent: Thursday, May 23, 2013 3:34 PM T

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-23 Thread Marc L. Allen
Behalf Of Dominique Devienne Sent: Thursday, May 23, 2013 8:57 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Max of 63 columns for a covering index to work? On Wed, May 22, 2013 at 9:11 PM, Marc L. Allen wrote: > [...]. It makes me think you might be better off using triggers

Re: [sqlite] Potential bug in crash-recovery code: unlink() and friends are not synchronous

2013-05-23 Thread Marc L. Allen
Just to throw in my $0.02 as a user Given the SQL stream of... COMMIT Vs. Except in cases where, in the first example, I have time to inform someone about the COMMIT before the power loss, there's no functional difference between the two events. I would hate to think I would ever d

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread Marc L. Allen
I haven't had a table that large, but I have had big ones... the disadvantage is the number of records you can scan in a single disk read, but an advantage is that you don't have to take the time to join tables, especially when you need to do it ALL THE TIME. -Original Message- From: sq

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread Marc L. Allen
records in the table, it was the only way to read from it in a performant fashion. -David -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marc L. Allen Sent: Wednesday, May 22, 2013 12:02 PM To: General Discussion of SQLite

Re: [sqlite] Max of 63 columns for a covering index to work?

2013-05-22 Thread Marc L. Allen
I think there might be a disconnect. You can have a covering index on a 300 column table... it just can't cover any column past the 63rd (or 64th?). It's not perfect, but not as bad as not being able to have a covering index at all. At least, that's how I read some of the answers. -Origin

Re: [sqlite] Query optimizer bug?

2013-04-30 Thread Marc L. Allen
esday, April 30, 2013 6:20 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Query optimizer bug? On Tue, Apr 30, 2013 at 5:46 PM, Marc L. Allen wrote: > In looking at the draft plan... am I right in assuming that at any 'stop' > you can eliminate paths wh

Re: [sqlite] Query optimizer bug?

2013-04-30 Thread Marc L. Allen
give enough bang for your buck, as the extra lower paths might rarely yield a final better result. Marc From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp [d...@sqlite.org] Sent: Tuesday, April 30, 2013 6:20

Re: [sqlite] Query optimizer bug?

2013-04-30 Thread Marc L. Allen
ne is used? Won't any path R-N2-x-y-z.. be identical to N2-R-x-y-z? Maybe I'm over simplifying? Marc -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Tuesday, April 30, 2013 5:34 PM To: sql

Re: [sqlite] [SQLite.Net] Right way to install precompiled binaries?

2013-04-18 Thread Marc L. Allen
Sorry... replied to the wrong message. :( -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Marc L. Allen Sent: Thursday, April 18, 2013 1:40 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] [SQLite.Net] Right

Re: [sqlite] [SQLite.Net] Right way to install precompiled binaries?

2013-04-18 Thread Marc L. Allen
It has around 500 context switches per second.. so I'm thinking MosYield. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of markus diersbock Sent: Thursday, April 18, 2013 1:37 PM To: General Discussion of SQLite Database Subjec

Re: [sqlite] SQLite strong-typing [WAS: inner vs. outer join inconsistency]

2013-03-08 Thread Marc L. Allen
If I have any doubt, I add .5 (or .05, .005, whatever) before the operation. I know that breaks algebraic rounding, but that's one I live with. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of James K. Lowden Sent: Friday, Ma

Re: [sqlite] Bug on real operations

2013-03-08 Thread Marc L. Allen
Yes.. for what it's worth, I've had this very same problem on MS SQL 2008. Comparing floating point values in their raw form is always dangerous. It just works so much more often than not that it's easy to forget until you get that one number that doesn't work. The solution for MS SQL was con

Re: [sqlite] Memory DB - Query does not return all records after Update

2013-02-26 Thread Marc L. Allen
Are you finalizing the UPDATE statement? -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of mike.akers Sent: Monday, February 25, 2013 4:48 PM To: sqlite-users@sqlite.org Subject: [sqlite] Memory DB - Query does not return all re

Re: [sqlite] Would anyone know how to use Sqlite to calculate the streakedness of data? The definition of streakedness is show below. Thank you for your help

2013-02-19 Thread Marc L. Allen
I haven't done SQLite coding in several months, and it's quite rusty, so I'll paraphrase. I haven't tested and if this is bogus, I'm sorry in advance. But maybe it'll give someone the right idea. You might be better off with a custom function, though. It would be something like this: CREATE

Re: [sqlite] SQLite 4

2013-02-12 Thread Marc L. Allen
Thanks. Any clue on whether we'll use an amalgamation as with SQLite4 or direct sources? Marc -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Richard Hipp Sent: Tuesday, February 12, 2013 11:32 AM To: General Discussi

[sqlite] SQLite 4

2013-02-12 Thread Marc L. Allen
ite 4, but have not been able to find any proposed release schedules. Can someone point me to an appropriate page or let me know if an official release is planned anytime soon? Our platform is proprietary, so I'll need to be incorporating source, not bina

Re: [sqlite] SQL query

2013-01-31 Thread Marc L. Allen
Actually... with that requirement, I wonder if it's even easier/better to use: Select name, min(setid), hash >From rtable Group by name, hash Having min(setid) > 0 -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Paul Sanders

  1   2   3   >