[sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Max Vlasov
Hi, my static linking with Delphi for 3.7.8 version now complains about _beginthreadex_/_endthreadex_. Quick search shows than everywhere there's a recommendation to use these functions instead of API CreateThread if one plans to use Visual c run-time (msvcrt). All my previous linking with

Re: [sqlite] Is msvcrt coupling now unavoidable (3.8.7)?

2014-10-22 Thread Max Vlasov
On Wed, Oct 22, 2014 at 4:50 PM, dave <d...@ziggurat29.com> wrote: > > > -Original Message- > > From: sqlite-users-boun...@sqlite.org > > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Max Vlasov > > Sent: Wednesday, October 22, 2014 5:25 AM >

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Max Vlasov
On Thu, Dec 4, 2014 at 10:44 AM, Baruch Burstein wrote: > > Is it possible to somehow search for/replace a string in all columns of all > tables? > Not particularity the answer to your question, but rather a method you or others might use. I once implemented a virtual table

Re: [sqlite] Search for text in all tables

2014-12-05 Thread Max Vlasov
>> I once implemented a virtual table "allvalues" that outputs all >> database values with (hope self-explaining) fields >> >> TableName, TableRowId, FieldName, Value > > Could you expand on how you coped with the underlying database > changing, and how you mapped virtual table rowids to the

Re: [sqlite] Artificially slow VACUUM by injecting a sleep() somewhere?

2014-12-08 Thread Max Vlasov
On Mon, Dec 8, 2014 at 5:56 PM, Roger Binns wrote: > On 12/07/2014 04:43 PM, David Barrett wrote: >> so I'm curious if you can think of a way using the API (or any >> other way) to essentially "nice" the process by inserting a short >> "sleep" into whatever loop runs inside

[sqlite] Sqlite as a platform performance comparison tool

2014-01-06 Thread Max Vlasov
Hi, A thought came to compare two computers of different platforms (ie i386 vs ARM) using uniform approach. We take two binaries of the same sqlite version compiled with the best c compilers for both platforms and compare the time spent for identical operations using memory based databases (to

Re: [sqlite] latest sqlite 3 with Delphi 5 professional

2014-01-24 Thread Max Vlasov
On Thu, Jan 23, 2014 at 1:33 AM, dean gwilliam wrote: > I'm just wondering what my options are here? > Any advice much appreciated. > ___ My two cents... Historically I took Aducom TDataSet-compatible classes

Re: [sqlite] latest sqlite 3 with Delphi 5 professional

2014-01-24 Thread Max Vlasov
On Fri, Jan 24, 2014 at 9:16 PM, Ralf Junker <ralfjun...@gmx.de> wrote: > On 24.01.2014 10:06, Max Vlasov wrote: > >> BCC 5.5 (freely downloadable) compiles any version of sqlite3 to >> object files linkable to Delphi 5 and later, the only drawback I >> >>

[sqlite] Once again about random values appearance

2014-02-13 Thread Max Vlasov
Hi, probably was discussed and modified before, but I still can not understand some peculiarities with random column values. The table Create table [TestTable] ([id] integer primary key) populated with 100 default values (thanks to CTE now made with a single query): with recursive

Re: [sqlite] Once again about random values appearance

2014-02-13 Thread Max Vlasov
On Thu, Feb 13, 2014 at 4:26 PM, Richard Hipp <d...@sqlite.org> wrote: > On Thu, Feb 13, 2014 at 4:45 AM, Max Vlasov <max.vla...@gmail.com> wrote: > > > Hi, > > > > probably was discussed and modified before, but I still can not > understand > >

Re: [sqlite] Once again about random values appearance

2014-02-13 Thread Max Vlasov
On Fri, Feb 14, 2014 at 6:35 AM, James K. Lowden wrote: > > > select id, (select id from TestTable where id = abs(random() % 100)) > > > as rndid from TestTable where id=rndid > > On Thu, 13 Feb 2014 07:26:55 -0500 > Richard Hipp wrote: > > > It is

[sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-02-14 Thread Max Vlasov
Hi, Some time ago when there was no "instr" functions, I looked at Mysql help pages and implemented a user function "locate" as the one that allows searching starting a particular position in the string. With two parameters form it was just identical to "instr" only the order of parameters was

Re: [sqlite] Once again about random values appearance

2014-02-16 Thread Max Vlasov
On Mon, Feb 17, 2014 at 1:22 AM, James K. Lowden <jklow...@schemamania.org>wrote: > On Fri, 14 Feb 2014 08:32:02 +0400 > Max Vlasov <max.vla...@gmail.com> wrote: > > > From: Max Vlasov <max.vla...@gmail.com> > > To: General Discussion of SQLite Datab

Re: [sqlite] Once again about random values appearance

2014-02-17 Thread Max Vlasov
On Mon, Feb 17, 2014 at 2:27 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 17 Feb 2014, at 7:59am, Max Vlasov <max.vla...@gmail.com> wrote: > > > So the nanosec example modified > > > > Select v-v from > > ( > > Select nanos

Re: [sqlite] Once again about random values appearance

2014-02-17 Thread Max Vlasov
On Mon, Feb 17, 2014 at 7:00 PM, RSmith <rsm...@rsweb.co.za> wrote: > > > On 2014/02/17 09:59, Max Vlasov wrote: >> >> . >> So >> >>Select nanosec() - nanosec() from ... >> >> returns non-zero values for most of the times, s

[sqlite] Latest Sqlite grammar as machine understandable file

2014-02-21 Thread Max Vlasov
Hi, Is there a machine-readable (BNF or other) grammar as equivalent to the current syntax diagrams? http://www.sqlite.org/syntaxdiagrams.html The only one a little similar I found is http://www.sqlite.org/docsrc/artifact/873cf35adf14cf34 ( mentioned as art/syntax/all-bnf.html ) but it's

Re: [sqlite] Latest Sqlite grammar as machine understandable file

2014-02-21 Thread Max Vlasov
On Fri, Feb 21, 2014 at 4:47 PM, Richard Hipp <d...@sqlite.org> wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> Is there a machine-readable (BNF or other) grammar as equivalent to > > Not that I am aware of. > I just no

Re: [sqlite] Latest Sqlite grammar as machine understandable file

2014-02-21 Thread Max Vlasov
On Fri, Feb 21, 2014 at 5:24 PM, Richard Hipp <d...@sqlite.org> wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> >> The only one a little similar I found is >> http://www.sqlite.org/docsrc/artifact/873cf35adf14cf3

Re: [sqlite] Question about how sqlite recovers after a power loss

2014-02-26 Thread Max Vlasov
On Wed, Feb 26, 2014 at 12:33 PM, Fabrice Triboix wrote: > > And even then, that would not explain why the journal file lingers after > re-opening the database. > I remember asking a similar question. As long as I remember, the main logical implication is that journal

Re: [sqlite] Virtual Table "Functions"

2014-03-01 Thread Max Vlasov
On Fri, Feb 28, 2014 at 10:14 PM, Dominique Devienne wrote: > Can someone tell me how the statement below works? > > > Thanks for any help on this. This is really puzzling to me. --DD Very puzzling for me too For any statement like this select * from blablabla(123)

Re: [sqlite] Virtual table API performance

2014-03-01 Thread Max Vlasov
Hi, thanks for explaining your syntax in another post. Now about virtual tables if you don't mind. On Fri, Feb 28, 2014 at 8:24 PM, Eleytherios Stamatogiannakis wrote: > > If we load into SQLite, > > create table newtable as select * from READCOMPRESSEDFILE('ctable.rc'); >

Re: [sqlite] Virtual table API performance

2014-03-02 Thread Max Vlasov
On Sun, Mar 2, 2014 at 5:21 PM, Elefterios Stamatogiannakis wrote: > > Our main test case is TPCH, a standard DB benchmark. The "lineitem" table of > TPCH contains 16 columns, which for 10M rows would require 160M xColumn > callbacks, to pass it through the virtual table API.

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 12:49 PM, Dominique Devienne wrote: > I think what SQLite lacks is a syntax to define custom function like > it does for virtual tables. Something like: > > create function rpad(x, y) using scripty_module as "return > PRINTF('%-*s',y,x)"; > Nice

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 6:39 PM, Clemens Ladisch <clem...@ladisch.de> wrote: > Max Vlasov wrote: >> >> Nice suggestion. This probably falls into case when a small new part >> needed on sqlite side > > Actually, no change to SQLite itself would be needed. It's

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Sat, Mar 8, 2014 at 2:16 AM, Clemens Ladisch wrote: > Eduardo Morras wrote: >> So, if a webapp that uses SQLite doesn't check it's input, functions that >> renames SQLite internals can be injected >> >> SELECT register_simple_function('MAX', 1, 'DROP TABLE ?'); > > Such a

Re: [sqlite] RPAD/LPAD

2014-03-07 Thread Max Vlasov
On Fri, Mar 7, 2014 at 11:51 PM, Dominique Devienne wrote: > > basically register_function('rpad', 'x', 'y', 'printf(''%-*s'', y, > x)') would register a 2-arg function (register_function's argc-2) > named $argv[0], which executes the following statement > > with

Re: [sqlite] RPAD/LPAD

2014-03-08 Thread Max Vlasov
On Sat, Mar 8, 2014 at 10:52 AM, Max Vlasov <max.vla...@gmail.com> wrote: > On Fri, Mar 7, 2014 at 11:51 PM, Dominique Devienne <ddevie...@gmail.com> > wrote: >> >> basically register_function('rpad', 'x', 'y', 'printf(''%-*s'', y, >> x)') would register a 2-ar

Re: [sqlite] Suggestion to add "locate" as a broader version of "instr"

2014-03-08 Thread Max Vlasov
On Sat, Mar 8, 2014 at 2:24 AM, big stone wrote: > Ooups ! > > Thanks to the awesome posts about "RPAD/LPAD", I understood that I could > already create a "sqrt()" function for SQLite3 in interpreted python. > Yes, that discussion was inspiring :) Looking at your task I

[sqlite] Observations about CTE optimization

2014-03-10 Thread Max Vlasov
Many CTE queries are just some mini-algorithms with iteration and only last row is required. I just wondered whether it's easy to do this without "order by ... " of the outer query (also mentioned in my reply about CTE sqrt). There's a solution, but the good news is that probably one rarely needs

Re: [sqlite] which of these is faster?

2014-03-14 Thread Max Vlasov
On Thu, Mar 13, 2014 at 11:06 PM, Richard Hipp wrote: > > Once you do that, you'll see that the opcode sequence is only slightly > different between the two. They should both run at about the same speed. > I doubt you'll be able to measure the difference. > > Actually a

Re: [sqlite] which of these is faster?

2014-03-14 Thread Max Vlasov
On Fri, Mar 14, 2014 at 4:51 PM, Richard Hipp wrote: >> > In the original problem, there was already an index on the term for which > the min() was requested. >. > Whit your CTE-generated random integers, there is not an index on the > values. So "SELECT min(x) FROM..."

Re: [sqlite] Using a customized collate function to mimic integer array type.

2014-03-21 Thread Max Vlasov
On Fri, Mar 21, 2014 at 8:06 PM, Ben Peng wrote: > > I guess I will have to take the longer route, namely define a customized > comparison function and translate user input internally. > There's an also virtual table method, probably not so easy to wrap the head around, but

Re: [sqlite] Goodram C50 SSD slow in SQlite benchmark

2014-03-23 Thread Max Vlasov
On Mon, Mar 24, 2014 at 4:49 AM, piotr maliński wrote: > I know it's bad. I'm trying to determine the cause of the difference, and > if it's a "feature" of that SSD or a bug of some sort. There was a very intensive discussion for a post labeled "UPDATE/INSERTing 1-2k rows

Re: [sqlite] comma-separated string data

2014-04-05 Thread Max Vlasov
On Fri, Apr 4, 2014 at 10:20 PM, peter korinis wrote: > A data column in a link table contains comma-separated string data, where > > How do you 'parse' a table entry like: "4,66,51,3009,2,678, ." to extract > these values and use them in an SQL statement, perhaps a WHERE

Re: [sqlite] Difference in virtual tables logic triggered between version 3.7.15.2 to 3.8.0

2014-04-05 Thread Max Vlasov
On Sat, Apr 5, 2014 at 11:48 PM, Max Vlasov <max.vla...@gmail.com> wrote: > > This works for an old version of sqlite (3.6.10), but today Dominique > Devienne mentioned some doubt about this approach and I decided to > test it with some data with a recent version of sql

Re: [sqlite] comma-separated string data

2014-04-07 Thread Max Vlasov
On Sun, Apr 6, 2014 at 10:23 PM, Dominique Devienne wrote: > > If the answer to either question above is true, then a specialized > vtable would be both more convenient and faster, no? > Hmm... If logical peculiarity of vtable approach (when where-constrained queries might

Re: [sqlite] about the apparently arriving soon "threads"

2014-04-08 Thread Max Vlasov
On Tue, Apr 8, 2014 at 11:00 PM, big stone wrote: > Hi, > > I did experiment splitting my workload in 4 threads on my cpu i3-350m to > see what are the scaling possibilities. > > Timing : > 1 cpu = 28 seconds > 2 cpu = 16 seconds > 3 cpu = 15 seconds > 4 cpu = 14 seconds >

[sqlite] Why sqlite has no sqlite_bind_auto or similary named function

2014-04-17 Thread Max Vlasov
Hi, The problem was with my program that automatically converts xml data into an sqilte table. It looks for an attribute and appends a column if it does not exists, but stating no particular type. All values were appended with sqlite_bind_text. Everything was fine, but an index created after this

Re: [sqlite] Why sqlite has no sqlite_bind_auto or similary named function

2014-04-18 Thread Max Vlasov
On Fri, Apr 18, 2014 at 8:08 PM, Andy Goth <andrew.m.g...@gmail.com> wrote: > On 4/18/2014 12:29 AM, Max Vlasov wrote: >> >> So it seems like if general queries allow affinity automatical >> selection while bind api does not have the corresponent function. I >>

[sqlite] CTE in views for older versions

2014-04-20 Thread Max Vlasov
Hi, noticed that attempt to open a database containing a view Create vew ... with recursive ... ... with older (non-cte) versions of sqlite failed. The call to open_v2 was ok, but any access for example to PRAGMA encoding led to "malformed database schema" error. Although it came as no big

Re: [sqlite] WITHOUT ROWID option

2014-05-09 Thread Max Vlasov
On Wed, May 7, 2014 at 6:31 PM, Richard Hipp wrote: > On Wed, May 7, 2014 at 9:00 AM, Marco Bambini wrote: > >> What is the best way to know if a table has been created with the WITHOUT >> ROWID option? >> > > > (1) You could send "SELECT rowid FROM table"

Re: [sqlite] Latest Sqlite grammar as machine understandable file

2014-05-10 Thread Max Vlasov
On Fri, Feb 21, 2014 at 5:24 PM, Richard Hipp <d...@sqlite.org> wrote: > On Fri, Feb 21, 2014 at 7:29 AM, Max Vlasov <max.vla...@gmail.com> wrote: > >> Is there a machine-readable (BNF or other) grammar as equivalent to >> the current syntax diagrams? > > An upd

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-06-03 Thread Max Vlasov
On Tue, May 27, 2014 at 10:49 PM, Richard Hipp wrote: > On Tue, May 27, 2014 at 10:50 AM, Richard Hipp wrote: >> > > This time I build the 32-bit DLL using mingw instead of MSVC. (MSVC was > still used for the 64-bit DLL.) So perhaps it will work correctly on

Re: [sqlite] Attaching vfs

2011-03-06 Thread Max Vlasov
On Mon, Mar 7, 2011 at 2:56 AM, Roger Binns <rog...@rogerbinns.com> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 03/06/2011 03:04 PM, Max Vlasov wrote: > > I don't think I need a solution that complex. > > You need to be very careful with your term

Re: [sqlite] Getting random data from grouped data in one table

2011-03-09 Thread Max Vlasov
up LIMIT 1 OFFSET abs(random() % (SELECT Count(*) FROM TB_Patient WHERE GroupId=$group) Both approaches should scan the table so slow for large tables by design, but I found the latter being a slightly faster, but I'm not sure whether this is always the case. Max Vlasov

[sqlite] Best approach for xBestIndex/xFilter effectiveness

2011-03-22 Thread Max Vlasov
can. But theoretically for large datasets one should at least think about some optimization. Thanks, Max Vlasov ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Create table if not exists and insert seed data

2011-03-22 Thread Max Vlasov
thing like CREATE TABLE IF NOT EXISTS [newTable] AS SELECT * FROM DataToPopulate DataToPopulate can be a table from the db or temporary table created for example when the program starts. Max Vlasov ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Best approach for xBestIndex/xFilter effectiveness

2011-03-22 Thread Max Vlasov
On Tue, Mar 22, 2011 at 2:25 PM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 03/22/2011 04:26 PM, Max Vlasov wrote: > > Hi, > > > > recently I finally started experimenting with virtual tables and there's > at > > least one thing I can not understand. >

[sqlite] Extremely large values error

2011-03-29 Thread Max Vlasov
Hi, I sometimes use repeated digits as test data, for example 123456789 repeated multiply times and recently some of my complex queries where I occasionally wrongly chose a field gave 'unknown error' in the middle of the process. Tracking it led to sqlite3AtoF function that appears to be raising

Re: [sqlite] Extremely large values error

2011-03-29 Thread Max Vlasov
On Tue, Mar 29, 2011 at 3:56 PM, Richard Hipp <d...@sqlite.org> wrote: > On Tue, Mar 29, 2011 at 4:48 AM, Max Vlasov <max.vla...@gmail.com> wrote: > > > Hi, > > > > I sometimes use repeated digits as test data, for example 123456789 > > repeated > >

Re: [sqlite] Extremely large values error

2011-03-30 Thread Max Vlasov
On Tue, Mar 29, 2011 at 8:17 PM, Ralf Junker <ralfjun...@gmx.de> wrote: > On 29.03.2011 15:17, Max Vlasov wrote: > > > Thanks, this forced me to search more on the topic. I use Delphi and it > > appears that all Borland compilers has their own floating-point exce

[sqlite] Dynamically loaded sqlite (linux)

2011-06-07 Thread Max Vlasov
Hi, I'm trying to use sqlite with linux (Ubuntu, Pascal, Lazarus). I'm still not very familiar with linux development so I might miss something essential. Two scenarios work ok - statically linked latest version compiled (3.7.6.3), no options or defines changed - Dynamically loaded (dlopen)

Re: [sqlite] Dynamically loaded sqlite (linux)

2011-06-09 Thread Max Vlasov
On Tue, Jun 7, 2011 at 9:22 PM, Martin Gadbois <mgadb...@gmail.com> wrote: > On Tue, Jun 7, 2011 at 12:52 PM, Jay A. Kreibich <j...@kreibi.ch> wrote: > > > On Tue, Jun 07, 2011 at 07:47:25PM +0400, Max Vlasov scratched on the > wall: > > > Hi, > > &

Re: [sqlite] Dynamically loaded sqlite (linux)

2011-06-09 Thread Max Vlasov
On Thu, Jun 9, 2011 at 6:21 PM, Pavel Ivanov wrote: > > > So if you ever want to use dlopen() you should be really really > careful to avoid loading the same library several times (even if the > same library have different file names). > > Pavel, thanks for the hint and the

Re: [sqlite] Dynamically loaded sqlite (linux)

2011-06-10 Thread Max Vlasov
On Thu, Jun 9, 2011 at 6:21 PM, Pavel Ivanov wrote: > > I know that I should avoid such things, but just curious, is it something > > inside sqlite that probably makes one dynanmically linked and other > > dynamically loaded library share global data and can this be

Re: [sqlite] Query with UNION on large table

2011-06-23 Thread Max Vlasov
s the sizes of the tables that should be ordered. Max Vlasov ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Query with UNION on large table

2011-06-23 Thread Max Vlasov
On Thu, Jun 23, 2011 at 10:20 PM, Rense Corten wrote: > Wow, I'm almost embarrassed by how helpful you are, gentlemen. Thanks a > lot. > > As to RAM: I'm trying this on two different machines, one with 12 Gb > and one with 32 Gb RAM. I won't be able to get more in the near >

Re: [sqlite] The last records of a query

2011-06-25 Thread Max Vlasov
On Sat, Jun 25, 2011 at 11:26 AM, Cecil Westerhof wrote: > With LIMIT you can get the first N records of a SELECT. Is it also possible > to get the last N records? > > Use ORDER BY ... DESC. Sure, if you have a large dataset, it'd better be indexed. Max

Re: [sqlite] Substring question

2011-06-25 Thread Max Vlasov
On Sat, Jun 25, 2011 at 9:53 AM, Pete wrote: > I need to select a substring of a column that starts 1 character after a > colon in the column and continues to the end of the column. For example, > if > the column contained "abc:xyz" I want the select statement to return

Re: [sqlite] randomness issues on windows

2011-06-27 Thread Max Vlasov
On Sat, Jun 25, 2011 at 11:20 PM, bob wrote: > i'm getting an issue relating to the use of the random() function in a > SQL query. > > i run 2 PHP scripts very quickly (less than 1 second apart). > > they use an SQL query like    SELECT * FROM table ORDER BY random() LIMIT 5; >

Re: [sqlite] SELECT query first run is VERY slow

2011-07-22 Thread Max Vlasov
On Fri, Jul 22, 2011 at 2:38 PM, Григорий Григоренко wrote: > I have a log's database. Schema : > > Query: > > SELECT 1 as today, id as rowid, kind,who,msg,computer,process,created_at,id > FROM log WHERE id > 4070636 AND id <= 9223372036854775807 AND kind = 'info' > AND

Re: [sqlite] SELECT query first run is VERY slow

2011-07-22 Thread Max Vlasov
On Fri, Jul 22, 2011 at 3:28 PM, Simon Slavin wrote: > > Does Windows XP have some sort of task display where you can see what task is > hogging most of the CPU or disk access ? > The mentioned Task Manager (Ctrl-Alt-Del -> Task Manager) reports both CPU and I/O Read Bytes

Re: [sqlite] SELECT query first run is VERY slow

2011-07-22 Thread Max Vlasov
On Fri, Jul 22, 2011 at 3:36 PM, Григорий Григоренко wrote: > Database extension is ".dblite" > > I'm using Process Explorer > (http://technet.microsoft.com/en-us/sysinternals/bb896653) to monitor > processes cpu and i/o usage. > > During these long running queries I am not

Re: [sqlite] SELECT query first run is VERY slow

2011-07-22 Thread Max Vlasov
On Fri, Jul 22, 2011 at 3:50 PM, Григорий Григоренко wrote: > Okay, I rebooted and tested again. > > First run took 76 seconds. Read bytes: ~ 307 Mb, Write bytes: ~ 66 Kb. > > Re-running: 1 second, Read bytes: ~ 307 Mb, Write bytes ~ 66 Kb. > > Grigory, you posted to me

Re: [sqlite] SELECT query first run is VERY slow

2011-07-22 Thread Max Vlasov
On Fri, Jul 22, 2011 at 5:25 PM, Григорий Григоренко wrote: > Database is "insert-only". There wasn't any deletes or updates, will VACUUM > actually help in this case? I though it was about unused space? > There's also internal fragmentation coming from the nature of

Re: [sqlite] SELECT query first run is VERY slow

2011-07-25 Thread Max Vlasov
On Mon, Jul 25, 2011 at 5:45 PM, Григорий Григоренко wrote: > > 1) SQLITE has to read about _half of index_ before it can use it (and > understand there are no records matching query). > > If cache is enough to hold 50 Mb then on subsuquent queries sqlite process is > not

Re: [sqlite] SELECT query first run is VERY slow

2011-07-26 Thread Max Vlasov
On Tue, Jul 26, 2011 at 2:18 PM, Simon Slavin wrote: > > On 26 Jul 2011, at 11:05am, Григорий Григоренко wrote: > > > This leads us to conclusion: index in SQLITE database if scattered and > cannot be "jumped directly" to N-th element. SQLITE has to read it somehow >

Re: [sqlite] SELECT query first run is VERY slow

2011-07-26 Thread Max Vlasov
2011/7/26 Black, Michael (IS) > > Turns out the if you include the primary key in an index it doesn't use the > triple index but uses the primary key instead. And analyze doesn't change > it. > > This is with version 3.7.5 > > Not sure about the primary index , because

Re: [sqlite] SELECT query first run is VERY slow

2011-07-26 Thread Max Vlasov
On Tue, Jul 26, 2011 at 8:50 PM, Григорий Григоренко wrote: > > EXPLAIN QUERY PLAN SELECT * FROM foo WHERE bar = 'three' and id > 290 > LIMIT 10; > > SELECT * FROM foo WHERE bar = 'three' and id > 290 LIMIT 10; > > > Run query. Now using idx2 index SQLITE reads only

Re: [sqlite] SELECT query first run is VERY slow

2011-07-28 Thread Max Vlasov
On Thu, Jul 28, 2011 at 11:41 AM, Григорий Григоренко wrote: > So, should we file this as a defect or bug somehow? > > As I understand currently the issues acknowledged and fixed during the e-mail conversation in this list ( read http://www.sqlite.org/src/wiki?name=Bug+Reports

Re: [sqlite] Exclusive locking mode not working as expected?

2011-07-29 Thread Max Vlasov
On Fri, Jul 29, 2011 at 10:49 AM, Jonathan Little wrote: > > This behavior seems undesirable to me -- we've got users of our application > copying the database file using Windows Explorer while it's being written > to, and ending up with inconsistent/corrupt databases. Am I

Re: [sqlite] Will SQLite supports UnQL?

2011-07-30 Thread Max Vlasov
On Sat, Jul 30, 2011 at 9:45 PM, Alexey Pechnikov wrote: > Very interesting annonce: > http://www.couchbase.com/press-releases/unql-query-language > > Thanks for the info, very interesting indeed. After some reading at http://www.unqlspec.org I'd rather think Richard

Re: [sqlite] Feature request: extend the IN operator

2011-08-07 Thread Max Vlasov
On Sun, Aug 7, 2011 at 3:17 PM, Alexey Pechnikov wrote: > Is it possible to support construction like to > > where x IN "1 2 3" > ... > > Does somebody interesting in this functionality too? > > I needed one, I just implemented mysql find_in_set as a user function. there

Re: [sqlite] Split Function for SQLite?

2011-08-24 Thread Max Vlasov
On Tue, Aug 23, 2011 at 7:10 AM, Gregory Moore wrote: > I need to split up a list of items in a single row so they each have > their own row. > You can read about my trick query solving partly this task with a trick

Re: [sqlite] Split Function for SQLite?

2011-08-25 Thread Max Vlasov
On Thu, Aug 25, 2011 at 9:34 AM, Max Vlasov <max.vla...@gmail.com> wrote: > > Also theoretically it is possible to use virtual tables for this. So > when your virtual query implementation accepts list in some way ('23, > 14, 1, 7, 9') and returns the table when querying >

Re: [sqlite] splitting a line to produce several lines?

2011-09-12 Thread Max Vlasov
On Mon, Sep 12, 2011 at 12:28 PM, Jean-Denis MUYS wrote: > > My question is: is there a pure SQL way to split the instances string, and > generate the instance lines from the instance list string? contrived example: > This kind of questions appear from time to time

[sqlite] Unexplained minor regression (bug) 3.7.8 up

2011-12-06 Thread Max Vlasov
(inclusive) returns results (2 rows). 3.7.8 and above shows empty result set Thanks, Max Vlasov ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Unexplained minor regression (bug) 3.7.8 up

2011-12-06 Thread Max Vlasov
On Tue, Dec 6, 2011 at 9:49 PM, Dan Kennedy <danielk1...@gmail.com> wrote: > On 12/06/2011 03:28 PM, Max Vlasov wrote: > >> Hi, >> Noticed a strange regression after 3.7.7 (in 3.7.8 and inherited in 3.7.9) >> >> > There is a candidate fix for this i

[sqlite] Changes to VFS starting 3.8.3

2016-03-10 Thread Max Vlasov
Hi, I have a compatibility problem with my vfs implementation of memory databases. I once implemented it successfully probably with a version 3.6.something. Today I tried to create a new database using the same code with the latest (3.11.1) version (the procedure is when no prior db data exists,

[sqlite] Changes to VFS starting 3.8.3

2016-03-10 Thread Max Vlasov
Thanks, I suspect there's indeed some special behavior not obvious at the moment. I'll try to gather some additional information if it's possible or detect this specific behavior On Thu, Mar 10, 2016 at 5:26 PM, Richard Hipp wrote: > On 3/10/16, Max Vlasov wrote: > &g

[sqlite] Changes to VFS starting 3.8.3

2016-03-11 Thread Max Vlasov
On Thu, Mar 10, 2016 at 5:26 PM, Richard Hipp wrote: > Perhaps your in-memory VFS was relying on some unspecified behavior > that changed? Some tests finally led to the source of my problems. When I implemented the handlers of vfs interface before, I made xFileControl return SQLITE_ERROR

Re: [sqlite] What languages can include SQLite statically?

2010-05-24 Thread Max Vlasov
Gilles, For Delphi I successfully used files from http://www.aducom.com to statically link sqlite files compiled with bcc (Borland command-line c compiler freely available now) with Delphi. Also the components of aducom.com will allow you to use all the power of Delphi database components with

[sqlite] Update detail record based on master properties

2010-05-26 Thread Max Vlasov
We all know UPDATE sometimes is limited so in order to make some complex conditional updating we can only rely on the complexity of WHERE clause. I would like to update my detail table based on master properties (so to set some value only if the corresponding master record fits some conditions).

Re: [sqlite] Update detail record based on master properties

2010-05-26 Thread Max Vlasov
> where exists ( > select 1 from master_table where >master_table.id=detail_table.masterid and >masterfieldtocheck = okvalue and >masterfield2tocheck = okvalue2); > > -- or > > where detail_table.masterid in ( > select id from master_table where >masterfieldtocheck = okvalue and

[sqlite] Does sqlite always allow creating own field named 'rowid'?

2010-05-26 Thread Max Vlasov
While implementing a table that intended for arbitrary table storage, I automatically named some field rowid not linking at the moment that it will have a name conflict with sqlite internal rowid name. Lately I discovered this, and (not a big deal) recreated table with a different name. But just

Re: [sqlite] Does sqlite always allow creating own field named 'rowid'?

2010-05-26 Thread Max Vlasov
On Wed, May 26, 2010 at 6:19 PM, Pavel Ivanov wrote: > > But just > > wondering, was allowing to create such field intentional? As I suppose > such > > field is complete phantom since most sql queries will interpret rowid > > internally and won't allow access this user field

Re: [sqlite] Aggregate and join query very slow

2010-05-27 Thread Max Vlasov
On Thu, May 27, 2010 at 3:07 PM, Michael Ash wrote: > ...These are large tables (52,355 records in facility and 4,085,137 in > release_cl). > > ... > sqlite> explain query plan > ...> SELECT name,score > ...> FROM facility f, (SELECT facilitynumber,SUM(score_rev) AS

Re: [sqlite] SQLite turns 10 years old

2010-05-29 Thread Max Vlasov
. If I had power, I'd be glad to calculate and see how many sqlite-related reads and writes are taking place on the whole earth. I'm sure it's a big number :) Thank you for sqlite! Max Vlasov On Sat, May 29, 2010 at 5:57 PM, D. Richard Hipp <d...@hwaci.com> wrote: > > Thanks, everybody,

[sqlite] Returning empty result set

2010-06-01 Thread Max Vlasov
Hi, Tried to figured out the simplest query returning empty result set without binding to any existing table. The query SELECT 1 WHERE 1=2 worked, but it looked a little strange ) and besides it didn't work in mysql. Will it work in future versions of sqlite or I'd be better to use a query

Re: [sqlite] Is the absence of msvcrt.dll a known issue with SQLite Windows 2000

2010-06-06 Thread Max Vlasov
On Sat, Jun 5, 2010 at 11:01 AM, Frank Church wrote: > > On checking the sqlite3.dll docs it states the only additional requirement > for it is msvcrt.dll. > Frank, as long as I know it's just a variation of sqlite3.dll that uses MS C run-time dynamically linked vs

Re: [sqlite] database corruption problem

2010-06-08 Thread Max Vlasov
ng randomly until specially interrupted. While the program reads and writes you check PRAGMA integrity_check; from time to time and stop if result shows corruption. If you can't reproduce the problem on your machine you can send specially prepared version to the user and ask him to perform

Re: [sqlite] Why "select count(distinct f1, f2) from tbl_test" can not work?

2010-06-26 Thread Max Vlasov
On Sat, Jun 26, 2010 at 7:27 AM, zhangzhenggui wrote: > tbl_test maybe like this: > create table tbl_test(f1, f2, f3); > > Now, I want to get the num of records which (f1, f2) are distinct. > > I try "select count(distinct f1, f2) from tbl_test", but error occur: SQL >

Re: [sqlite] WAL questions

2010-07-07 Thread Max Vlasov
Alexey, I read this sentence, but it didn't help. So I suppose there's a bug in PRAGMA journal_mode logic Steps to reproduce. 1. Create an empty base with some table. Look at the 18,19 offsets, they both = 1, it's ok, the base is compatible with full range of sqlite3 versions. 2. Do PRAGMA

Re: [sqlite] How to determine when to VACUUM?

2010-07-08 Thread Max Vlasov
> >> (I guess it well might not on an SSD disk, but on a conventional > >> rotational disk, pager could read several pages ahead with one seek - > >> but does it?) > > > > No, the pager does not. Among other things, my feeling is that the > > locality of pages is not very strong, unless the

Re: [sqlite] WAL questions

2010-07-08 Thread Max Vlasov
> You want "PRAGMA main.journal_mode" > > A "PRAGMA journal_mode;" (without the "main.") shows you the default > journal > mode used by newly created databases, which is always "DELETE" unless you > have changed it with a prior "PRAGMA journal_mode=MODE" command. > > Though, I will admit, this is

Re: [sqlite] WAL questions

2010-07-08 Thread Max Vlasov
Second Proposed Change: > > Remove the WAL mode from "PRAGMA journal_mode". The journal_mode pragma > only specifies the various rollback journal modes. Enable the WAL using a > separate pragma such as "PRAGMA wal=ON; PRAGMA wal=OFF;" > > Thoughts? Comments? Other suggestions? > > Maybe it's

Re: [sqlite] How to determine when to VACUUM?

2010-07-08 Thread Max Vlasov
>> > > > > Simon, you gave an interesting explanation, but does this rule work in > > general? I mean there are many models, many sizes and so on. > > Don't know. You could test it. Write a program that creates a file half > the size of the drive, then writes to random parts of it timing each >

[sqlite] Suggestion for sqlite shell

2010-07-12 Thread Max Vlasov
ignoring extra fields with padding. I don't know whether the clipboard content can be used in sqlite ideologically, but in my case it saved additional time allowing importing for example from excel without the intermediate file (csv). Thanks Max Vlasov www.maxerist.net

Re: [sqlite] Suggestion for sqlite shell

2010-07-12 Thread Max Vlasov
On Mon, Jul 12, 2010 at 5:00 PM, Alexey Pechnikov wrote: > Maxim, please show example here and the link to your implementation. > > Alexey, to illustrate I prepared a screen shot http://www.maxerist.net/downloads/temp/bind_iterate.png excel and cells to be copied are at

Re: [sqlite] WAL: no longer able to use read-only databases?

2010-07-13 Thread Max Vlasov
> > > In testing the latest SQLite snapshot with WAL enabled, it seems that > > there's no way to use a database in a read-only location. > > > > Documentation on the developers' current view of this issue can be found > here: > > > In my opinion it's ok, WAL already has special conditions on

  1   2   3   4   5   >