Re: [sqlite] SQLite Database Browser v3.2 released

2014-07-08 Thread jose isaias cabrera
justin wrote... A quick FYI. SQLite Database Browser v3.2 has been released. This version has a OSX .dmg binary for download as well as the Windows .exe + Linux/BSD/etc compatible source. https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/sqlb-3.2.0 Hope that's useful for

[sqlite] SQLite Database Browser v3.2 released

2014-07-08 Thread justin
A quick FYI. SQLite Database Browser v3.2 has been released. This version has a OSX .dmg binary for download as well as the Windows .exe + Linux/BSD/etc compatible source. https://github.com/sqlitebrowser/sqlitebrowser/releases/tag/sqlb-3.2.0 Hope that's useful for people (there's a lot

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-08 Thread Simon Slavin
On 8 Jul 2014, at 11:25pm, Mayank Kumar (mayankum) wrote: > Our process can restart unexpectedly sometimes and sometimes we die so that > we can come up with a new version or failover. The locking may depend on how the process crashes (restarts) and how much the operating

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Simon Slavin
On 8 Jul 2014, at 11:11pm, Hinrichsen, John wrote: > This > applies when creating a table using a SELECT where a column is the result > of an expression (such as min, max, or sum) or within a CTE (in the example > provided, where the expression can obviously only produce

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-08 Thread Mayank Kumar (mayankum)
Thanks Simon and Richard. Our process can restart unexpectedly sometimes and sometimes we die so that we can come up with a new version or failover. But I am pretty sure we don't do anything specifically like closing the db before dieing. For cases where we know we are dying, I can put

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Hinrichsen, John
In most cases it should be possible for SQLite to perform type inference, i.e. deduce the type of an expression, rather than assign the column affinity to None for all columns that are produced by expressions. This applies when creating a table using a SELECT where a column is the result of an

Re: [sqlite] sqlite & multi process usage

2014-07-08 Thread Simon Slavin
On 8 Jul 2014, at 8:39pm, Micka wrote: > i'm using sqlite in different process. Sometimes I got the error Busy ... => > > When SQLite tries to access a file that is locked by another process, the > default behavior is to return SQLITE_BUSY. > > > So how can I prevent

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-08 Thread Simon Slavin
On 8 Jul 2014, at 8:58pm, Mayank Kumar (mayankum) wrote: > We have a process with a single sqlite db and a single connection to the > database from a thread. From time to time our processs restarts Does your application close the database as part of the restart process ?

Re: [sqlite] Query help

2014-07-08 Thread Simon Slavin
> On 8 Jul 2014, at 9:01pm, Paul Sanderson wrote: > > 0, microsoft, mac > 1, oracle, mac > 2, oracle, pc SELECT t1.recno, t2.name, t3.name FROM t1 JOIN t2 ON t2.a = t1.a JOIN t3 ON t3.b = t1.b ORDER BY t1.recno If you have lots of data on your tables this

Re: [sqlite] One App - two encrypted databases & acitvation key

2014-07-08 Thread Richard Hipp
On Tue, Jul 8, 2014 at 10:48 AM, kartikpatel...@air-watch.com < kartikpatel...@air-watch.com> wrote: > Question 1: Is there any limitation on number of databases getting > encrypted within one application? In my case I have a Windows 8 Modern app > that uses a class library. Class library

[sqlite] One App - two encrypted databases & acitvation key

2014-07-08 Thread kartikpatel...@air-watch.com
Question 1: Is there any limitation on number of databases getting encrypted within one application? In my case I have a Windows 8 Modern app that uses a class library. Class library instantiates it's own database. So application end up with two databases. My test harness for class library

Re: [sqlite] Query help

2014-07-08 Thread Igor Tandetnik
On 7/8/2014 4:01 PM, Paul Sanderson wrote: i have three tables create table t1 (recno int, a int, b int) create table t2 (a int, name text) create table t3 (b int, name text) I want to create a query that lists all rows in t1 but rather than the integers a and b I want to display the

Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-08 Thread Richard Hipp
On Tue, Jul 8, 2014 at 3:58 PM, Mayank Kumar (mayankum) wrote: > Hi All > > We have a process with a single sqlite db and a single connection to the > database from a thread. From time to time our processs restarts and reopens > the database or tries to create the database if

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread mm.w
Hello, Keith Medcalf would not be "more simple" just to say "create your own metadata wrapper" which is perfectly doable and legitimate in such case. Best. On Tue, Jul 8, 2014 at 10:47 AM, Simon Slavin wrote: > > On 8 Jul 2014, at 6:16pm, Hinrichsen, John

[sqlite] Query help

2014-07-08 Thread Paul Sanderson
I suspect this is easy i have three tables create table t1 (recno int, a int, b int) create table t2 (a int, name text) create table t3 (b int, name text) I want to create a query that lists all rows in t1 but rather than the integers a and b I want to display the associated names from t2 and

[sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-08 Thread Mayank Kumar (mayankum)
Hi All We have a process with a single sqlite db and a single connection to the database from a thread. From time to time our processs restarts and reopens the database or tries to create the database if it doesn't exists. Sometimes when the process restarts, we get the error "database is

[sqlite] sqlite & multi process usage

2014-07-08 Thread Micka
Hi, i'm using sqlite in different process. Sometimes I got the error Busy ... => When SQLite tries to access a file that is locked by another process, the default behavior is to return SQLITE_BUSY. So how can I prevent that ? you said : When any process wants to write, it must lock the

Re: [sqlite] Sqlite & detect change in column

2014-07-08 Thread Micka
Ok, I've looked up at : sqlite3_set_authorizer So it looks like that I can be notified when the update query try to modify a column. Good. Thx you very much, I will try that later ^^ On Tue, Jul 8, 2014 at 9:04 PM, Micka wrote: > Ok, > > In my Program, I need to be

Re: [sqlite] Sqlite & detect change in column

2014-07-08 Thread Micka
Ok, In my Program, I need to be notified when a column is modified ( which one). How can I do that? Thank you very much, Le 8 juil. 2014 17:10, "Roger Binns" a écrit : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/07/14 23:22, Micka wrote: > > I know that

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Simon Slavin
On 8 Jul 2014, at 6:16pm, Hinrichsen, John wrote: >>> It would be more intuitive: why should aggregate functions like min(), >>> max(), and sum() return column data stripped of the original column >>> affinity? Can you talk us through the original problem again ? Are you

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Hinrichsen, John
Hi Richard, Your concern about breaking existing code makes a lot of sense. Would you consider a PRAGMA or compile-time directive to enable keeping column affinity where possible? I tested postgres, and found that columns produced by aggregate functions retain the column affinity of the input

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Keith Medcalf
There is a way around this: I am going to use a wholenumber virtual table for z because, for me, this is easier than fiddling with CTE's to generate integer sequences. It makes no difference (other than it also executes about a million times faster than the CTE). You will note that the CTE

Re: [sqlite] random row from group

2014-07-08 Thread Clemens Ladisch
Patrick Donnelly wrote: > I'm trying to find a way to select a random row from a group (rather > than "arbitrary"). Something like: > > SELECT attr1, attr2 > FROM foo > GROUP BY attr1 > ORDER BY attr1, random() > > but of course ORDER BY is done after GROUP BY has selected an > arbitrary row. To

[sqlite] random row from group

2014-07-08 Thread Patrick Donnelly
Hi, I'm trying to find a way to select a random row from a group (rather than "arbitrary"). Something like: SELECT attr1, attr2 FROM foo GROUP BY attr1 ORDER BY attr1, random() but of course ORDER BY is done after GROUP BY has selected an arbitrary row. Looking online, I've seen non-standard

Re: [sqlite] Sqlite & detect change in column

2014-07-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/07/14 23:22, Micka wrote: > I know that there is a callback that can be called when a column is > updated. Are you sure about that? > SQLITE_API void *sqlite3_update_hook( [...] > I tried to find when this function is called in the sqlite3.c

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Richard Hipp
On Tue, Jul 8, 2014 at 11:01 AM, Hinrichsen, John wrote: > Hi, > > Would you consider changing the column affinity determination rules Probably not. There are over a half million apps (literally) in circulation that use the existing rules. Changing the rules would break

Re: [sqlite] Planner chooses incorrect index

2014-07-08 Thread Dan Kennedy
On 06/25/2014 04:44 PM, João Ramos wrote: The sample column has some sensitive data that I can't share, so I'll have to change it and then try to reproduce the problem (I removed it before because I assumed that it wouldn't be important). On Mon, Jun 23, 2014 at 3:26 PM, Dan Kennedy

Re: [sqlite] column affinity and the query planner's use of indices

2014-07-08 Thread Hinrichsen, John
Hi, Would you consider changing the column affinity determination rules so that expressions would, at least in easy-to-deduce cases, automatically assign the appropriate column affinity? Making this change would improve the performance of some queries (see my original email.) It would be more

Re: [sqlite] SQLite JDBC column count

2014-07-08 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/07/14 22:51, Manoj wrote: > Is there any workaround available for this? https://sqlite.org/limits.html#max_column Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1 iEYEARECAAYFAlO8B14ACgkQmOOfHg372QRr6QCfZfbcFkz/lowVT8uBFy92FY/7

Re: [sqlite] SQLite JDBC column count

2014-07-08 Thread Simon Slavin
On 8 Jul 2014, at 6:51am, Manoj wrote: > Am using SQLite jdbc 3.7.2 and in a scenario i have a table with 2300 column > which eventually throwed too many columns exception since the maximum > allowed column count is 2000. > > Is there any workaround available

Re: [sqlite] affinity critical problem with 3.8.5 - IN single value optimisation

2014-07-08 Thread Richard Hipp
On Tue, Jul 8, 2014 at 10:35 AM, Hinrichsen, John wrote: > This is a nasty bug; I do not see any follow-up regarding a fix. > Fix is here (I think): http://www.sqlite.org/src/info/92f7ad43dbfe > > > On Thu, Jun 26, 2014 at 9:17 AM, Guillaume Fougnies < >

Re: [sqlite] affinity critical problem with 3.8.5 - IN single value optimisation

2014-07-08 Thread Jan Nijtmans
2014-07-08 16:35 GMT+02:00 Hinrichsen, John : > This is a nasty bug; I do not see any follow-up regarding a fix. Regards, Jan Nijtmans

Re: [sqlite] affinity critical problem with 3.8.5 - IN single value optimisation

2014-07-08 Thread Hinrichsen, John
This is a nasty bug; I do not see any follow-up regarding a fix. On Thu, Jun 26, 2014 at 9:17 AM, Guillaume Fougnies wrote: > Hi, > > It seems there's a problem with 3.8.5 and its affinity behavior. > It's quite critical. > > --- CUT --- > sqlite> CREATE TABLE T (v

Re: [sqlite] sqlite-3.8.5: query takes quite a while to execute although there is a "limit 0" clause

2014-07-08 Thread Hick Gunter
All the second program does is - start a transaction - lock two tables - halt Which is quite fast ;) The first one goes through a lot of trouble before realizing it has already finished. -Ursprüngliche Nachricht- Von: Nissl Reinhard [mailto:reinhard.ni...@fee.de] Gesendet: Dienstag,

Re: [sqlite] sqlite-3.8.5: query takes quite a while to execute although there is a "limit 0" clause

2014-07-08 Thread Nissl Reinhard
Hi Gunter, I'll provide explanations for the first and the last of the previously mentioned queries: sele order from deta - 1 0 0 SCAN TABLE ProfileDetail AS d USING COVERING INDEX ix_profiledetail_client 0 0 1

[sqlite] SQLite JDBC column count

2014-07-08 Thread Manoj
Am using SQLite jdbc 3.7.2 and in a scenario i have a table with 2300 column which eventually throwed too many columns exception since the maximum allowed column count is 2000. Is there any workaround available for this? Maybe a query to increase column limit in SQLite jdbc? Thanks in advance!

Re: [sqlite] Sqlite in dead lock state when deleting records from the same table from different threads

2014-07-08 Thread dada
> Hi, > > How can I find this in the statement ? > > Will BEGIN immediate get > an exclusive lock.? or like Igor specified if I > call "Delete * from where > 0" will it be able to get an immediate lock on > the table. > > Srikanth From > docs: After a BEGIN IMMEDIATE, no other database

Re: [sqlite] sqlite-3.8.5: query takes quite a while to execute although there is a "limit 0" clause

2014-07-08 Thread Hick Gunter
Output from .explain explain query plan select... explain select... would be interesting -Ursprüngliche Nachricht- Von: Nissl Reinhard [mailto:reinhard.ni...@fee.de] Gesendet: Dienstag, 08. Juli 2014 11:46 An: sqlite-users@sqlite.org Betreff: [sqlite] sqlite-3.8.5: query takes quite a

Re: [sqlite] CRUD Statistics

2014-07-08 Thread Hick Gunter
You can use the sqlite3_update_hook() interface to supply a callback that is invoked for (most, see documentation) INSERT, UPDATE and DELETE operations (database name, table name and rowid are passed). You can use the sqlite3_commit_hook() and sqlite3_rollback_hook() functions to determine

Re: [sqlite] Building for vxWorks

2014-07-08 Thread Andy Ling
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Eduardo Morras > Sent: 08 July 2014 10:19 > On Mon, 7 Jul 2014 12:44:54 + > Andy Ling wrote: > > > Building the original file with the

[sqlite] sqlite-3.8.5: query takes quite a while to execute although there is a "limit 0" clause

2014-07-08 Thread Nissl Reinhard
Hi, when I run this query: select * from ( WITH Processes AS ( SELECT DISTINCT d.SummaryId, d.ProcessId, d.Client FROM ProfileDetail d WHERE d.Client <> 'unknown' ) SELECT q.*, p.Client FROM QueryTrace q INNER JOIN Processes p ON q.SummaryId = p.SummaryId AND

Re: [sqlite] CRUD Statistics

2014-07-08 Thread Mohit Sindhwani
Hi Sandu, On 8/7/2014 2:46 PM, Sandu Buraga wrote: Is there a possibility to extract a statistic of how many CRUD operations do I have during an application life-cycle? I would like to find-out how many INSERTs do I have, how many SELECTs and so on. My guess is that the best way would be by

Re: [sqlite] Building for vxWorks

2014-07-08 Thread Eduardo Morras
On Mon, 7 Jul 2014 12:44:54 + Andy Ling wrote: > Building the original file with the flags. > > -DHAVE_UTIME -DSQLITE_OMIT_LOAD_EXTENSION > -DSQLITE_ENABLE_LOCKING_STYLE > > I get the following errors. > > sqlite3.c: In function 'posixFchown': >

[sqlite] CRUD Statistics

2014-07-08 Thread Sandu Buraga
Hi, Is there a possibility to extract a statistic of how many CRUD operations do I have during an application life-cycle? I would like to find-out how many INSERTs do I have, how many SELECTs and so on. In particular I am focusing for multithreaded scenario, with multiple read/write operations

Re: [sqlite] Building for vxWorks

2014-07-08 Thread Andy Ling
> -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Jan Nijtmans > Sent: 07 July 2014 20:14 > 2014-07-07 14:44 GMT+02:00 Andy Ling : > > Removing the SQLITE_ENABLE_LOCKING_STYLE I get > ... >