--- Marco Bambini <[EMAIL PROTECTED]> wrote:
> Here it is the output of explain SELECT a FROM One WHERE b1 = 99 AND  
> b2 = 100 and b3 = 101;
> 
> 0|Goto|0|20||1|
> Integer|0|0||2|
> OpenRead|1|4|keyinfo(3,BINARY,BINARY)|3|
> SetNumColumns|1|4||4|
> Integer|99|0||5|
> IsNull|-1|18||6|
> Integer|100|0||7|
> IsNull|-2|18||8|
> Integer|101|0||9|
> IsNull|-3|18||10|
> MakeRecord|3|0|ddd|11|
> MemStore|0|0||12|
> MoveGe|1|18||13|
> MemLoad|0|0||14|
> IdxGE|1|18|+|15|
> Column|1|0||16|
> Callback|1|0||17|
> Next|1|13||18|
> Close|1|0||19|
> Halt|0|0||20|
> Transaction|0|0||21|
> VerifyCookie|0|2||22|
> Goto|0|1||23|
> Noop|0|0||
> 
> result for CW is still 99...

Are you sure you're using an unmodified build of sqlite 3.4.2?
The explain output is quite different.
You have 24 instructions, whereas with 3.4.2/gcc you see 28.

In your CodeWarrior explain output, only the INDEX btree is opened, 
and your version is outputting the zero'th column of the index btree,
which happens to be b1, hence the erroneous 99.

In the 3.4.2/gcc explain output you can see both the TABLE btree
and the INDEX btree being opened, and the zero'th column of the 
table btree is correctly output.

If you compile sqlite 3.4.2 in debug mode with all compiler optimizations
disabled, do you get the same result? (Create a new database with just
the sql commands below.)

SQLite version 3.4.2
Enter ".help" for instructions
sqlite> CREATE TABLE One( a varchar primary key, b1 integer, b2 integer, b3 
integer, z varchar );
sqlite> CREATE UNIQUE INDEX idx_One ON One( b1, b2, b3 );
sqlite> explain SELECT a FROM One WHERE b1 = 99 AND b2 = 100 and b3 = 101;
0|Goto|0|25|
1|Integer|0|0|# One
2|OpenRead|0|2|
3|SetNumColumns|0|4|
4|Integer|0|0|# idx_One
5|OpenRead|1|4|keyinfo(3,BINARY,BINARY)
6|Integer|99|0|
7|IsNull|-1|22|
8|Integer|100|0|
9|IsNull|-2|22|
10|Integer|101|0|
11|IsNull|-3|22|
12|MakeRecord|3|0|ddd
13|MemStore|0|0|
14|MoveGe|1|22|
15|MemLoad|0|0|
16|IdxGE|1|22|+
17|IdxRowid|1|0|
18|MoveGe|0|0|
19|Column|0|0|# One.a
20|Callback|1|0|
21|Next|1|15|
22|Close|0|0|
23|Close|1|0|
24|Halt|0|0|
25|Transaction|0|0|
26|VerifyCookie|0|2|
27|Goto|0|1|
28|Noop|0|0|



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to