[sqlite] BestIndex problem

2015-05-22 Thread Emmanouil Karvounis
Thank you so much for your answers, we managed to do what we wanted. Best, Manos Stamatis On 21 May 2015 at 21:42, Dan Kennedy wrote: > On 05/21/2015 10:20 PM, Emmanouil Karvounis wrote: > >> Greetings, >> >> We are having an issue with BestIndex in our Virtual Table

[sqlite] BestIndex problem

2015-05-21 Thread Emmanouil Karvounis
Greetings, We are having an issue with BestIndex in our Virtual Table implementation. Allow us to illustrate the problem with a simple example. We create a virtual table named 'vt' that conceptually has 3 columns "value1, value2, value3" and then we want to execute the following queries: 1)

Re: [sqlite] Streaming group by in union of already sorted tables

2015-01-23 Thread Emmanouil Karvounis
complexity, something very important when aiming at the embedded systems enviroment. Let me know if you need us to provide any further details or other assistance. Regards, Manos On 23 January 2015 at 21:30, Richard Hipp <d...@sqlite.org> wrote: > On 1/23/15, Emmanouil Karvounis <man.

Re: [sqlite] Streaming group by in union of already sorted tables

2015-01-23 Thread Emmanouil Karvounis
> > Sorry, but SQLite does not understand how the subquery (inside the > brackets) is going to be used by the main query. It hqs to complete the > subquery first and only then can it inspect the main query to find out how > to optimize it. This is not a bug, there just isn't enough flexibility

Re: [sqlite] Streaming group by in union of already sorted tables

2015-01-23 Thread Emmanouil Karvounis
p. run count(*) and output 1. The sqlite plan calls for merging both tables in a B-tree and scanning it, which incurs unneeded time and space complecity compared to the above. Manos On 23 January 2015 at 18:59, Emmanouil Karvounis <man...@di.uoa.gr> wrote: > Dear Simon, > > Than

Re: [sqlite] Streaming group by in union of already sorted tables

2015-01-23 Thread Emmanouil Karvounis
org> wrote: > > On 23 Jan 2015, at 4:15pm, Emmanouil Karvounis <man...@di.uoa.gr> wrote: > > > In short, we have two tables that are already sorted on a combination of > > two fields > > There is no such thing as a 'sorted table' in SQL. Each table is a s

Re: [sqlite] Streaming group by in union of already sorted tables

2015-01-23 Thread Emmanouil Karvounis
query planner. This is a bug report, not a request for assistance on formulating our query. I do appreciate the effort and your good will, though. Thank you again. Manos On 23 January 2015 at 18:48, Clemens Ladisch <clem...@ladisch.de> wrote: > Emmanouil Karvounis wrote: > > In sho

[sqlite] Streaming group by in union of already sorted tables

2015-01-23 Thread Emmanouil Karvounis
Greetings, We are having an issue with the sqlite query plan for one of our queries, which seems to be sub-optimal both in time and in space complexity. In short, we have two tables that are already sorted on a combination of two fields (which are their primary keys) and we want to union them