[sqlite] ANALYZE, sqlite_stat1, and query planning

2016-04-28 Thread Rowan Worth
Hi guys, In an attempt to understand a slow query I've had a quick look at the contents of the sqlite_stat1 table. It looks like the stat column contains a series of integers like: ... Is this observation correct? And if so, does sqlite essentially assume that the rows are equally distributed

[sqlite] ANALYZE, sqlite_stat1, and query planning

2016-04-28 Thread Dominique Devienne
On Thu, Apr 28, 2016 at 5:53 PM, Richard Hipp wrote: > > It looks like the ENABLE_STAT2/STAT4 options generate histogram data > which > > would probably help for non-uniform data? > > Yes, STAT4 provides histogram data to help with query planning on > tables with non-uniform data distributions.

[sqlite] ANALYZE, sqlite_stat1, and query planning

2016-04-28 Thread Dominique Devienne
On Thu, Apr 28, 2016 at 5:28 PM, Rowan Worth wrote: > In an attempt to understand a slow query I've had a quick look at the > contents of the sqlite_stat1 table. It looks like the stat column contains > a series of integers like: > > > > > ... > > Is this observation correct? And if so, does s

[sqlite] ANALYZE, sqlite_stat1, and query planning

2016-04-28 Thread Richard Hipp
On 4/28/16, Richard Hipp wrote: > On 4/28/16, Dominique Devienne wrote: >> >> Richard, is STAT3 or STAT4 required for >> https://www.sqlite.org/optoverview.html#skipscan ? >> Or essential for skip-scan to bring the most benefit? --DD > > No. But sqlite_stat1 data is. Skip-scan is only attempted

[sqlite] ANALYZE, sqlite_stat1, and query planning

2016-04-28 Thread Richard Hipp
On 4/28/16, Dominique Devienne wrote: > > Richard, is STAT3 or STAT4 required for > https://www.sqlite.org/optoverview.html#skipscan ? > Or essential for skip-scan to bring the most benefit? --DD No. But sqlite_stat1 data is. Skip-scan is only attempted if there are an average of 18 or more rep

[sqlite] ANALYZE, sqlite_stat1, and query planning

2016-04-28 Thread Richard Hipp
On 4/28/16, Rowan Worth wrote: > Hi guys, > > In an attempt to understand a slow query I've had a quick look at the > contents of the sqlite_stat1 table. It looks like the stat column contains > a series of integers like: > > > > > ... > > Is this observation correct? And if so, does sqlite ess

[sqlite] analyze

2015-09-10 Thread R.Smith
On 2015-09-10 09:05 AM, Ludovic Aubert wrote: > Hello, > > I am facing a strange issue: > I am calling sqlite3_execute(db, "ANALYZE;") from a C program after a bunch > of CREATE and INSERT, > Then this program exits. > Another exe tries to perform some selects into the db, but it seems like > ANA

[sqlite] analyze

2015-09-10 Thread Simon Slavin
On 10 Sep 2015, at 8:05am, Ludovic Aubert wrote: > I am calling sqlite3_execute(db, "ANALYZE;") from a C program after a bunch > of CREATE and INSERT, > Then this program exits. Are you checking the result returned by that C call to make sure it is SQLITE_OK ? Simon.

[sqlite] analyze

2015-09-10 Thread Ludovic Aubert
Hello, I am facing a strange issue: I am calling sqlite3_execute(db, "ANALYZE;") from a C program after a bunch of CREATE and INSERT, Then this program exits. Another exe tries to perform some selects into the db, but it seems like ANALYZE had no effect and the queries take about 10 mn to complete

Re: [sqlite] Analyze optimizing views?

2013-10-16 Thread Richard Hipp
On Wed, Oct 16, 2013 at 10:29 AM, Daniel Polski wrote: > Hello, > Does the ANALYZE command gather statistics and optimize for views I've > created or only "real tables"? > Only real tables. Views are just macros that are applied to queries when the queries are run. If you have: CREATE TABL

[sqlite] Analyze optimizing views?

2013-10-16 Thread Daniel Polski
Hello, Does the ANALYZE command gather statistics and optimize for views I've created or only "real tables"? Best regards, Daniel ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] ANALYZE OFF ?

2013-07-08 Thread Richard Hipp
On Mon, Jul 8, 2013 at 12:10 PM, Simon Slavin wrote: > This question mostly applies to SQLite4, where a number of things will be > changing anyway. > > How do folks feel about the ANALYZE command ? I started off thinking > about wanting an 'ANALYZE OFF' command to delete the tables that ANALYZE

[sqlite] ANALYZE OFF ?

2013-07-08 Thread Simon Slavin
This question mostly applies to SQLite4, where a number of things will be changing anyway. How do folks feel about the ANALYZE command ? I started off thinking about wanting an 'ANALYZE OFF' command to delete the tables that ANALYZE makes up. But that just made me think that the ANALYZE comma

Re: [sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Simon Slavin
On 18 Aug 2011, at 2:03pm, Kristoffer Danielsson wrote: > Hi, The problem is that the database is around 100 MB large (the error goes > away if I remove unimportant data). Also, it contains data I'd like to keep > private. I do have a specific select query that produces what I believe is a > d

Re: [sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Richard Hipp
On Thu, Aug 18, 2011 at 9:03 AM, Kristoffer Danielsson < kristoffer.daniels...@live.se> wrote: > > Hi, The problem is that the database is around 100 MB large (the error goes > away if I remove unimportant data). Also, it contains data I'd like to keep > private. I do have a specific select query

Re: [sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Kristoffer Danielsson
qlite.org > Subject: Re: [sqlite] ANALYZE necessary after database upgrade? > > On Thu, Aug 18, 2011 at 8:50 AM, Kristoffer Danielsson < > kristoffer.daniels...@live.se> wrote: > > > > > > > > > > > I have noticed that certain (complex) select quer

Re: [sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Kristoffer Danielsson
p the database and send it to the sqlite team for analysis? > From: slav...@bigfraud.org > Date: Thu, 18 Aug 2011 13:57:31 +0100 > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] ANALYZE necessary after database upgrade? > > > On 18 Aug 2011, at 1:50pm, Kristoffer Danie

Re: [sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Richard Hipp
On Thu, Aug 18, 2011 at 8:50 AM, Kristoffer Danielsson < kristoffer.daniels...@live.se> wrote: > > > > > I have noticed that certain (complex) select queries return unexpected data > (missing rows) on my upgraded SQLite databases.My guess is that the > optimizer makes an erroneous decision on some

Re: [sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Simon Slavin
On 18 Aug 2011, at 1:50pm, Kristoffer Danielsson wrote: > I have noticed that certain (complex) select queries return unexpected data > (missing rows) on my upgraded SQLite databases. What do you mean by 'upgraded' ? > My guess is that the optimizer makes an erroneous decision on some index (I

[sqlite] ANALYZE necessary after database upgrade?

2011-08-18 Thread Kristoffer Danielsson
I have noticed that certain (complex) select queries return unexpected data (missing rows) on my upgraded SQLite databases.My guess is that the optimizer makes an erroneous decision on some index (I'm using both sqlite_stat1 and sqlite_stat2). Is this a reasonable guess? Is it necessary to r

[sqlite] "analyze" command slow for large amounts of data; alternative possible?

2009-02-16 Thread John Wood
The problem --- I'm using the "ANALYZE" command of SQLITE to try and improve performance for queries. However, I'm finding that the actual analyze call can take a long time to run for large amounts of rows (e.g. >2). This is especially the case if a lot of data has been changed betwe

RE: [sqlite] Analyze before or after setting indices?

2006-12-30 Thread RB Smissaert
Thanks; I obviously missed something very essential there. RBS -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 30 December 2006 14:56 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Analyze before or after setting indices? "RB Smissaert" <[EM

Re: [sqlite] Analyze before or after setting indices?

2006-12-30 Thread drh
"RB Smissaert" <[EMAIL PROTECTED]> wrote: > Doing some performance tweaking and wondering if there are any logical > reasons why it would be better to analyze a table before or after setting > the indices. I could figure it out by timing, but maybe somebody could tell > me already why one is better

[sqlite] Analyze before or after setting indices?

2006-12-30 Thread RB Smissaert
Doing some performance tweaking and wondering if there are any logical reasons why it would be better to analyze a table before or after setting the indices. I could figure it out by timing, but maybe somebody could tell me already why one is better than the other. RBS -

[sqlite] ANALYZE command

2005-08-09 Thread Mikio Kishi
Hi, I recently downloaded sqlite source code via cvs repository. In this source, I found out a new command which name is "ANALYZE". (analyze.c) It's like the oracle ANALYZE command, right ? Please tell me more about it and how to use. Sencerely, Mikio Kishi