diff --git a/manifest b/manifest index 69357054f1..5afa0d39ec 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Have\sFTS\stake\sadvantage\sof\s"docidpIndex; pIdx; pIdx=pIdx->pNext){ - if( pIdx->bUnordered==0 && (!pBest || pIdx->nColumnnColumn) ){ + if( pIdx->bUnordered==0 + && pIdx->pPartIdxWhere==0 + && (!pBest || pIdx->nColumnnColumn) + ){ pBest = pIdx; } } diff --git a/test/index6.test b/test/index6.test index 0b440451c1..c427dc3df3 100644 --- a/test/index6.test +++ b/test/index6.test @@ -37,6 +37,13 @@ do_test index6-1.1 { } } {14 20 ok} +# Make sure the count(*) optimization works correctly with +# partial indices. Ticket [a5c8ed66cae16243be6] 2013-10-03. +# +do_execsql_test index6-1.1.1 { + SELECT count(*) FROM t1; +} {20} + # Error conditions during parsing... # do_test index6-1.2 {