1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Improvements to distinct aggregates such that they can sometimes avoid

using an ephermeral table to test for duplicates if the column that is
distinct is part of an index.

FossilOrigin-Name: ef4ac0ddd297bbd38351410c5a387e1628561b3f1bec9e4c2c9d76fbe29f955a
This commit is contained in:
drh
2021-03-24 17:28:11 +00:00
6 changed files with 340 additions and 98 deletions

View File

@@ -2603,6 +2603,7 @@ struct AggInfo {
FuncDef *pFunc; /* The aggregate function implementation */
int iMem; /* Memory location that acts as accumulator */
int iDistinct; /* Ephemeral table used to enforce DISTINCT */
int iDistAddr; /* Address of OP_OpenEphemeral */
} *aFunc;
int nFunc; /* Number of entries in aFunc[] */
u32 selId; /* Select to which this AggInfo belongs */