Per Richard's request, I have produced the WhereTrace for the query that uses virtual tables and the same query that is not using virtual tables. That output is at the end of this message. Ultimately, I think my question is, how should I respond to xBestIndex such that SQLite will perform the query as efficiently with virtual tables as it does when I copy all the data into SQLite?
Hick asked: > Are you setting the constraintUsage return parameters correctly? I suspect not. I think I don't understand what to do when xBestIndex is passed multiple constraints, because those are the cases when SQLite rejects my indexes. And, from debugging, my indexes are being rejected because this condition (at the tail end of whereLoopFindLesser()): if( (p->prereq & pTemplate->prereq)==pTemplate->prereq /* (1) */ is false, so the costs I am returning never get considered. Here is an example. For the inventory table, xBestIndex gets called twice, each time with 4 constraints, 3 of which happen to be the same, film_id, presumably because inventory.film_id is used in 3 different join constraints: jmpvtab BEST INDEX: Table: inventory nConstraints: 4 CONST[0]: 0 (inventory_id) = Unusable CONST[1]: 1 (film_id) = Unusable CONST[2]: 1 (film_id) = Unusable CONST[3]: 1 (film_id) = Unusable Index NOT created: est. cost: 440393770484721 jmpvtab BEST INDEX: Table: inventory nConstraints: 4 CONST[0]: 0 (inventory_id) = Usable CONST[1]: 1 (film_id) = Usable CONST[2]: 1 (film_id) = Usable CONST[3]: 1 (film_id) = Usable Index created: est. cost: 1 The first time, all the constraints are marked unusable, so I set argvIndex and omit to 0 for all four constraints and set the estimatedCost to a ridiculously large number. The second time, all of the constraints are marked as usable. My data does not have any pre-existing indexes; I'm willing to create whatever indexes are needed to speed up the query. So I set omit to 1 and argvIndex to 1, 2, 3, and 4 respectively for the four constraints. This is clearly where I am confusing SQLite. Here is a simpler example, for the film_actor table. xBestIndex is again called twice: jmpvtab BEST INDEX: Table: film_actor nConstraints: 2 CONST[0]: 1 (film_id) = Unusable CONST[1]: 0 (actor_id) = Unusable Index NOT created: est. cost: 890034380901136 jmpvtab BEST INDEX: Table: film_actor nConstraints: 2 CONST[0]: 1 (film_id) = Usable CONST[1]: 0 (actor_id) = Usable Index created: est. cost: 1 Here again, in the second case, I set omit to 1 for both and set argvIndex to 1 for film_id and 2 for actor_id. What I am trying to tell SQLite is that I am willing to make an index that sorts first by film_id and then by actor_id for rows with the same film_id. But I'm thinking that's not what SQLite wants. Since I'm going to have to create an index for whichever constraint that SQLite is going to filter on, maybe I should just take the first constraint, set omit to 1 and argvIndex to 1, and set omit and argvIndex to 0 for all other constraints? And then set the cost to n(log n) where n is number of rows, since that is the cost of making an index? Thanks very much for your help. WhereTrace follows: ===================================== WhereTrace when USING virtual tables: ===================================== New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 skip: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 skip: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 skip: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** constraint[0]: col=3 termid=12 op=2 usabled=0 constraint[1]: col=2 termid=13 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 usage[1]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=10000 estimatedRows=10 add: * 0.01.00 t1 (-999,0) f 00400 N 0 cost 0,132,33 constraint[0]: col=3 termid=12 op=2 usabled=1 constraint[1]: col=2 termid=13 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 usage[1]: argvIdx=2 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=1 add: * 0.01.07 t1 (0,3) f 00400 N 2 cost 0,0,0 constraint[0]: col=0 termid=0 op=2 usabled=0 constraint[1]: col=1 termid=9 op=2 usabled=0 constraint[2]: col=1 termid=10 op=2 usabled=0 constraint[3]: col=1 termid=11 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 usage[1]: argvIdx=0 omit=0 usage[2]: argvIdx=0 omit=0 usage[3]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=4.40394e+14 estimatedRows=4581 add: * 1.02.01 t2 (-999,0) f 00400 N 0 cost 0,490,120 constraint[0]: col=0 termid=0 op=2 usabled=1 constraint[1]: col=1 termid=9 op=2 usabled=1 constraint[2]: col=1 termid=10 op=2 usabled=1 constraint[3]: col=1 termid=11 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 usage[1]: argvIdx=2 omit=1 usage[2]: argvIdx=3 omit=1 usage[3]: argvIdx=4 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=3 add: * 1.02.3f t2 (0,f) f 00400 N 4 cost 0,0,16 constraint[0]: col=0 termid=1 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=1.28738e+11 estimatedRows=599 add: * 2.04.03 t3 (-999,0) f 00400 N 0 cost 0,370,92 constraint[0]: col=0 termid=1 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=2 replace: * 2.04.03 t3 (-999,0) f 00400 N 0 cost 0,370,92 add: * 2.04.03 t3 (0,1) f 00400 N 1 cost 0,0,10 constraint[0]: col=0 termid=2 op=2 usabled=0 constraint[1]: col=1 termid=8 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 usage[1]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=1e+12 estimatedRows=1000 add: * 3.08.07 t6 (-999,0) f 00400 N 0 cost 0,400,99 constraint[0]: col=0 termid=2 op=2 usabled=1 constraint[1]: col=1 termid=8 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 usage[1]: argvIdx=2 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=3 add: * 3.08.7f t6 (0,3) f 00400 N 2 cost 0,0,16 constraint[0]: col=0 termid=3 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=1e+12 estimatedRows=1000 add: * 4.10.0f t4 (-999,0) f 00400 N 0 cost 0,400,99 constraint[0]: col=0 termid=3 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=3 replace: * 4.10.0f t4 (-999,0) f 00400 N 0 cost 0,400,99 add: * 4.10.0f t4 (0,1) f 00400 N 1 cost 0,0,16 constraint[0]: col=1 termid=4 op=2 usabled=0 constraint[1]: col=0 termid=7 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 usage[1]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=8.90034e+14 estimatedRows=5462 add: * 5.20.1f t5 (-999,0) f 00400 N 0 cost 0,500,123 constraint[0]: col=1 termid=4 op=2 usabled=1 constraint[1]: col=0 termid=7 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 usage[1]: argvIdx=2 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=3 add: * 5.20.ff t5 (0,3) f 00400 N 2 cost 0,0,16 constraint[0]: col=0 termid=5 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=65536 estimatedRows=16 add: * 6.40.3f t8 (-999,0) f 00400 N 0 cost 0,160,40 constraint[0]: col=0 termid=5 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=1 replace: * 6.40.3f t8 (-999,0) f 00400 N 0 cost 0,160,40 add: * 6.40.3f t8 (0,1) f 00400 N 1 cost 0,0,0 constraint[0]: col=0 termid=6 op=2 usabled=0 usage[0]: argvIdx=0 omit=0 idxNum=-999 idxStr= orderByConsumed=0 estimatedCost=1.6e+09 estimatedRows=200 add: * 7.80.7f t7 (-999,0) f 00400 N 0 cost 0,305,76 constraint[0]: col=0 termid=6 op=2 usabled=1 usage[0]: argvIdx=1 omit=1 idxNum=0 idxStr= orderByConsumed=0 estimatedCost=1 estimatedRows=2 replace: * 7.80.7f t7 (-999,0) f 00400 N 0 cost 0,305,76 add: * 7.80.7f t7 (0,1) f 00400 N 1 cost 0,0,10 0 0.01.00 t1 (-999,0) f 00400 N 0 cost 0,132,33 1 0.01.07 t1 (0,3) f 00400 N 2 cost 0,0,0 2 1.02.01 t2 (-999,0) f 00400 N 0 cost 0,490,120 3 1.02.3f t2 (0,f) f 00400 N 4 cost 0,0,16 4 2.04.03 t3 (0,1) f 00400 N 1 cost 0,0,10 5 3.08.07 t6 (-999,0) f 00400 N 0 cost 0,400,99 6 3.08.7f t6 (0,3) f 00400 N 2 cost 0,0,16 7 4.10.0f t4 (0,1) f 00400 N 1 cost 0,0,16 8 5.20.1f t5 (-999,0) f 00400 N 0 cost 0,500,123 9 5.20.ff t5 (0,3) f 00400 N 2 cost 0,0,16 a 6.40.3f t8 (0,1) f 00400 N 1 cost 0,0,0 b 7.80.7f t7 (0,1) f 00400 N 1 cost 0,0,10 ---- begin solver. (nRowEst=0) New 0 cost=132, 33 order=0 ---- after round 0 ---- 0 cost=132 nrow=33 order=0 New 02 cost=523,153 order=0 ---- after round 1 ---- 02 cost=523 nrow=153 order=0 New 024 cost=523,163 order=0 ---- after round 2 ---- 024 cost=523 nrow=163 order=0 New 0245 cost=564,262 order=0 ---- after round 3 ---- 0245 cost=564 nrow=262 order=0 New 02457 cost=564,278 order=0 ---- after round 4 ---- 02457 cost=564 nrow=278 order=0 New 024578 cost=778,401 order=0 ---- after round 5 ---- 024578 cost=778 nrow=401 order=0 New 024578a cost=778,401 order=0 ---- after round 6 ---- 024578a cost=778 nrow=401 order=0 New 024578ab cost=778,411 order=0 ---- after round 7 ---- 024578ab cost=778 nrow=411 order=0 ---- Solution nRow=411 0 0.01.00 t1 (-999,0) f 00400 N 0 cost 0,132,33 2 1.02.01 t2 (-999,0) f 00400 N 0 cost 0,490,120 4 2.04.03 t3 (0,1) f 00400 N 1 cost 0,0,10 5 3.08.07 t6 (-999,0) f 00400 N 0 cost 0,400,99 7 4.10.0f t4 (0,1) f 00400 N 1 cost 0,0,16 8 5.20.1f t5 (-999,0) f 00400 N 0 cost 0,500,123 a 6.40.3f t8 (0,1) f 00400 N 1 cost 0,0,0 b 7.80.7f t7 (0,1) f 00400 N 1 cost 0,0,10 *** Optimizer Finished *** ===================================== WhereTrace when NOT using virtual tables: ===================================== *** Optimizer Start *** add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,200 0 0.01.00 sqlite_master f 00100 N 0 cost 0,216,200 ---- begin solver. (nRowEst=0) New 0 cost=216,200 order=0 ---- after round 0 ---- 0 cost=216 nrow=200 order=0 ---- begin solver. (nRowEst=201) New 0 cost=216,200 order=1 ---- after round 0 ---- 0 cost=216 nrow=200 order=1 rev=0x0 ---- Solution nRow=200 ORDERBY=1,0x0 0 0.01.00 sqlite_master f 00100 N 0 cost 0,216,200 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** ---- Solution nRow=1 0 0.01.00 sqlite_master f 01101 N 1 cost 0,33,1 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 add: * 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 0 0.01.00 sqlite_master f 04000 N 1 cost 271,53,43 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=271, 43 order=0 Update 1 cost=216,180 order=0 was 0 cost=271, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=0 ---- begin solver. (nRowEst=181) ---- sort cost=239 (1/1) increases cost 271 to 272 New 0 cost=272, 43 order=0 Update 1 cost=216,180 order=1 was 0 cost=272, 43 order=0 ---- after round 0 ---- 1 cost=216 nrow=180 order=1 rev=0x0 ---- Solution nRow=180 ORDERBY=1,0x0 1 0.01.00 sqlite_master f 00100 N 0 cost 0,216,180 *** Optimizer Finished *** *** Optimizer Start *** add: * 0.01.00 t1 f 00100 N 0 cost 0,216,200 add: * 1.02.01 t2 f 04000 N 1 cost 271,53,43 add: * 1.02.01 t2 f 00100 N 0 cost 0,216,180 add: * 2.04.03 t3 f 04000 N 1 cost 271,53,43 add: * 2.04.03 t3 f 00100 N 0 cost 0,216,180 add: * 3.08.07 t6 f 04000 N 1 cost 271,53,43 add: * 3.08.07 t6 f 00100 N 0 cost 0,216,180 add: * 4.10.0f t4 f 04000 N 1 cost 271,53,43 add: * 4.10.0f t4 f 00100 N 0 cost 0,216,180 add: * 5.20.1f t5 f 04000 N 1 cost 271,53,43 add: * 5.20.1f t5 f 00100 N 0 cost 0,216,180 add: * 6.40.3f t8 f 04000 N 1 cost 271,53,43 add: * 6.40.3f t8 f 00100 N 0 cost 0,216,180 add: * 7.80.7f t7 f 04000 N 1 cost 271,53,43 add: * 7.80.7f t7 f 00100 N 0 cost 0,216,180 0 0.01.00 t1 f 00100 N 0 cost 0,216,200 1 1.02.01 t2 f 04000 N 1 cost 271,53,43 2 1.02.01 t2 f 00100 N 0 cost 0,216,180 3 2.04.03 t3 f 04000 N 1 cost 271,53,43 4 2.04.03 t3 f 00100 N 0 cost 0,216,180 5 3.08.07 t6 f 04000 N 1 cost 271,53,43 6 3.08.07 t6 f 00100 N 0 cost 0,216,180 7 4.10.0f t4 f 04000 N 1 cost 271,53,43 8 4.10.0f t4 f 00100 N 0 cost 0,216,180 9 5.20.1f t5 f 04000 N 1 cost 271,53,43 a 5.20.1f t5 f 00100 N 0 cost 0,216,180 b 6.40.3f t8 f 04000 N 1 cost 271,53,43 c 6.40.3f t8 f 00100 N 0 cost 0,216,180 d 7.80.7f t7 f 04000 N 1 cost 271,53,43 e 7.80.7f t7 f 00100 N 0 cost 0,216,180 ---- begin solver. (nRowEst=0) New 0 cost=216,200 order=0 ---- after round 0 ---- 0 cost=216 nrow=200 order=0 New 01 cost=275,243 order=0 Skip 02 cost=416,380 order=0 vs 01 cost=275,243 order=0 ---- after round 1 ---- 01 cost=275 nrow=243 order=0 New 013 cost=301,286 order=0 Skip 014 cost=459,423 order=0 vs 013 cost=301,286 order=0 ---- after round 2 ---- 013 cost=301 nrow=286 order=0 New 0135 cost=340,329 order=0 Skip 0136 cost=502,466 order=0 vs 0135 cost=340,329 order=0 ---- after round 3 ---- 0135 cost=340 nrow=329 order=0 New 01357 cost=383,372 order=0 Skip 01358 cost=545,509 order=0 vs 01357 cost=383,372 order=0 ---- after round 4 ---- 01357 cost=383 nrow=372 order=0 New 013579 cost=426,415 order=0 Skip 01357a cost=588,552 order=0 vs 013579 cost=426,415 order=0 ---- after round 5 ---- 013579 cost=426 nrow=415 order=0 New 013579b cost=469,458 order=0 Skip 013579c cost=631,595 order=0 vs 013579b cost=469,458 order=0 ---- after round 6 ---- 013579b cost=469 nrow=458 order=0 New 013579bd cost=512,501 order=0 Skip 013579be cost=674,638 order=0 vs 013579bd cost=512,501 order=0 ---- after round 7 ---- 013579bd cost=512 nrow=501 order=0 ---- Solution nRow=501 0 0.01.00 t1 f 00100 N 0 cost 0,216,200 1 1.02.01 t2 f 04000 N 1 cost 271,53,43 3 2.04.03 t3 f 04000 N 1 cost 271,53,43 5 3.08.07 t6 f 04000 N 1 cost 271,53,43 7 4.10.0f t4 f 04000 N 1 cost 271,53,43 9 5.20.1f t5 f 04000 N 1 cost 271,53,43 b 6.40.3f t8 f 04000 N 1 cost 271,53,43 d 7.80.7f t7 f 04000 N 1 cost 271,53,43 *** Optimizer Finished ***