Add a comment explaining why fts5 cannot cache "sorter statements".

FossilOrigin-Name: e6af3b7a3cf331210f4c87848e2af007dbd5ef30
This commit is contained in:
dan
2014-07-31 17:53:03 +00:00
parent 937490d4b4
commit 3dbfc8d8e8
3 changed files with 14 additions and 7 deletions
+7
View File
@@ -491,6 +491,13 @@ static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bAsc){
memset(pSorter, 0, nByte);
pSorter->nIdx = nPhrase;
/* TODO: It would be better to have some system for reusing statement
** handles here, rather than preparing a new one for each query. But that
** is not possible as SQLite reference counts the virtual table objects.
** And since the statement required here reads from this very virtual
** table, saving it creates a circular reference.
**
** If SQLite a built-in statement cache, this wouldn't be a problem. */
zSql = sqlite3_mprintf("SELECT rowid, %s FROM %Q.%Q ORDER BY +%s %s",
pConfig->zName, pConfig->zDb, pConfig->zName, FTS5_RANK_NAME,
bAsc ? "ASC" : "DESC"