RE: [sqlite] using "+" for avoiding using indexes in "group by"

2007-11-06 Thread orefkov
Hi.

> You can't.  
> 
> Why are you trying to avoid the use of indices?  Most people 
> like it when their indices make an ORDER BY go faster.  And 
> why are you worried about duplicate data in a transient 
> table, as long as you are getting the correct answer?
> 
Thanks for reply.
Just in real query I has one constraint, usable for other index, and this
index is are better.
With using this index need process only 2000 records and sort it,
and using other index need process 100 records and test it for
constraint.
And I can't change the structure of indexes, becose table is a virtual table
from other data source.

So, I will try better calculate cost in my xBestIndex.

WBR, Alexandr Orefkov.



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] using "+" for avoiding using indexes in "group by"

2007-11-06 Thread drh
"orefkov" <[EMAIL PROTECTED]> wrote:
> Hi All.
> 
> When I used "+" for avoiding using indexes in "order by" list,
> this cause a duplicate columns in ephemeral "sort" table.
> 
> Example:
> 
> "select col1, col2, sum(col3) from ttab group by +col1, col2"
> 
> In this case, ephemeral table contain 5 columns, where column 0 and 3 are
> duplicate:
> 
>   25  Column 0  0   # ttab.col1
>   26  Column 0  1   # ttab.col2
>   27  Sequence   1  0
>   28  Column 0  0   # ttab.col1
>   29  Column 0  2   # ttab.col3
>   30  MakeRecord 5  0
>   31  IdxInsert  1  0
> 
> How I can force SQLite don't use index on grouping, and don't add duplicate
> column in ephemeral table?
> 

You can't.  

Why are you trying to avoid the use of indices?  Most people
like it when their indices make an ORDER BY go faster.  And
why are you worried about duplicate data in a transient table,
as long as you are getting the correct answer?

--
D. Richard Hipp <[EMAIL PROTECTED]>


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



[sqlite] using "+" for avoiding using indexes in "group by"

2007-11-06 Thread orefkov
Hi All.

When I used "+" for avoiding using indexes in "order by" list,
this cause a duplicate columns in ephemeral "sort" table.

Example:

"select col1, col2, sum(col3) from ttab group by +col1, col2"

In this case, ephemeral table contain 5 columns, where column 0 and 3 are
duplicate:

  25  Column 0  0   # ttab.col1
  26  Column 0  1   # ttab.col2
  27  Sequence   1  0
  28  Column 0  0   # ttab.col1
  29  Column 0  2   # ttab.col3
  30  MakeRecord 5  0
  31  IdxInsert  1  0

How I can force SQLite don't use index on grouping, and don't add duplicate
column in ephemeral table?

WBR, Alexandr Orefkov.



-
To unsubscribe, send email to [EMAIL PROTECTED]
-