Home | History | Annotate | Download | only in dist

Lines Matching refs:Distinct

9054 ** The sqlite3_keyword_count() interface returns the number of distinct
10673 ** CAPI3REF: Determine if a virtual table query is DISTINCT
10711 ** This mode is used for a DISTINCT query.
10723 ** that have both DISTINCT and ORDER BY clauses.
10747 ** (or "IS NOT DISTINCT FROM") and not "==".
16202 ** 0x00020000 Transform DISTINCT into GROUP BY
16321 ** pointer will work here as long as it is distinct from SQLITE_STATIC
18926 #define SQLITE_DistinctOpt 0x00000010 /* DISTINCT using indexes */
19884 tRowcnt *anDLt; /* Est. number of distinct keys less than this sample */
19945 int iDistinct; /* Ephemeral table used to enforce DISTINCT */
20127 #define EP_Distinct 0x000004 /* Aggregate function with DISTINCT keyword */
20484 #define WHERE_DISTINCTBY 0x0080 /* pOrderby is really a DISTINCT clause */
20485 #define WHERE_WANT_DISTINCT 0x0100 /* All output needs to be distinct */
20487 #define WHERE_AGG_DISTINCT 0x0400 /* Query is "SELECT agg(DISTINCT ...)" */
20496 #define WHERE_DISTINCT_NOOP 0 /* DISTINCT keyword not used */
20645 #define SF_Distinct 0x0000001 /* Output should be DISTINCT */
20732 ** rows. Name means: "Distinct Fifo".
20736 ** are distinct.
20755 /* The DISTINCT clause is ignored for all of the above. Not that
29519 u32 currentCount; /* Current number of distinct checkouts */
34280 ((p->selFlags & SF_Distinct) ? " DISTINCT" : ""),
56281 ** a hash table that will hold up to BITVEC_MXHASH distinct values.
57472 ** Since there cannot be more than 2^31 distinct pages in a database,
84858 pDestDb, SQLITE_ERROR, "source and destination must be distinct"
103858 ** are inserted in distinct phases, which each set contains no duplicates.
115730 return 0; /* No DISTINCT keyword and no aggregate functions */
116557 /* If there is both a DISTINCT and an OFFSET clause, then allocate
116870 /* Ordinary Step 3, for the case where FALSE and NULL are distinct */
123532 ** number of distinct entries in the index that are less than the
124263 ** If D is the count of distinct values and K is the total number of
124593 ** row, we know that all the rest will be distinct, so skip
125113 i64 nDist100; /* Number of distinct values in index */
125125 /* Set nSum to the number of distinct (iCol+1) field prefixes that
130419 ** must have names that are distinct from normal automatic index names.
130421 ** "sqlite3_butoindex..." in order to make the names distinct.
130647 ** considered distinct and both result in separate indices.
139492 ** if <table2> and <table1> are distinct tables but have identical
141736 return 0; /* SELECT may not be DISTINCT */
148778 ** how to process the DISTINCT keyword, to simplify passing that information
148783 u8 isTnct; /* 0: Not distinct. 1: DISTINCT 2: DISTINCT and ORDER BY */
148785 int tabTnct; /* Ephemeral table used for DISTINCT processing */
149651 ** iMem form a distinct entry. This is used by both "SELECT DISTINCT ..." and
149652 ** distinct aggregates ("SELECT count(DISTINCT <expr>) ..."). Three strategies
149673 ** is not distinct and control jumps to VM address addrRepeat. Otherwise,
149683 ** In this case it has already been determined that the rows are distinct.
149696 int addrRepeat, /* Jump to here if not distinct */
149903 DistinctCtx *pDistinct, /* If not NULL, info on how to process DISTINCT */
149910 int hasDistinct; /* True if the DISTINCT keyword is present */
150048 /* If the DISTINCT keyword was present on the SELECT statement
150190 /* This occurs in cases where the SELECT had both a DISTINCT and
150351 ** index to implement a DISTINCT test.
150403 ** where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which
151469 /* Allocate cursors numbers for Queue and Distinct. The cursor number for
151470 ** the Distinct table must be exactly one greater than Queue in order
151481 /* Allocate cursors for Current, Queue, and Distinct. */
152912 ** (3d) the outer query may not be DISTINCT.
152915 ** (4) The subquery can not be DISTINCT.
152917 ** (**) At one point restrictions (4) and (5) defined a subset of DISTINCT
152919 ** (4) has since been expanded to exclude all DISTINCT subqueries.
152922 ** If the subquery is aggregate, the outer query may not be DISTINCT.
152958 ** or DISTINCT, and
152962 ** (17d2) DISTINCT
152975 ** operators have an implied DISTINCT which is disallowed by
152998 ** DISTINCT. (See ticket [752e1646fc]).
153144 ** that make up the compound SELECT are allowed to be aggregate or distinct
153763 ** * the sub-query uses only one distinct window frame, and
155434 sqlite3ErrorMsg(pParse, "DISTINCT aggregates must have exactly one "
155441 ExplainQueryPlan((pParse, 0, "USE TEMP B-TREE FOR %s(DISTINCT)",
155883 ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10)
155919 return 0; /* Not an aggregate nor DISTINCT */
156323 ** * DISTINCT ORDER BY -> GROUP BY optimization tag-select-0500
156327 ** * Setup for DISTINCT tag-select-0680
156353 DistinctCtx sDistinct; /* Info on how to code the DISTINCT keyword */
156912 ** If the query is DISTINCT with an ORDER BY but is not an aggregate, and
156916 ** SELECT DISTINCT xyz FROM ... ORDER BY xyz
156923 ** used for both the ORDER BY and DISTINCT processing. As originally
156925 ** BY and DISTINCT, and an index or separate temp-table for the other.
156951 TREETRACE(0x20000,pParse,p,("Transform DISTINCT into GROUP BY:\n"));
157010 /* Open an ephemeral index to use for the distinct set. tag-select-0680
157045 /* TUNING: For a UNION CTE, because UNION is implies DISTINCT,
157314 "DISTINCT" : "GROUP BY"
157665 explainTempTable(pParse, "DISTINCT");
163170 u16 nDistinctCol; /* Index columns used to sort for DISTINCT */
168282 ** 2. The SELECT statement is not an aggregate or DISTINCT query, and
168630 ** WHERE clause returns outputs for DISTINCT processing.
169200 ** Return true if the DISTINCT expression-list passed as the third argument
169203 ** A DISTINCT list is redundant if any subset of the columns in the
169204 ** DISTINCT list are collectively unique and individually non-null.
169210 ExprList *pDistinct /* The result set that needs to be DISTINCT */
169218 ** this query, then it will not be possible to show that the DISTINCT
169236 ** the DISTINCT qualifier redundant. It does so if:
169258 /* This index implies that the DISTINCT qualifier is redundant. */
172730 ** a column with just two distinct values where each value has about
173196 ** Return true if ORDER BY clause may be handled as DISTINCT.
173326 /* Call xBestIndex once for each distinct value of (prereqRight & ~mPrereq)
173709 ** strict. With GROUP BY and DISTINCT the only requirement is that
173711 ** and DISTINCT do not require rows to appear in any particular order as long
173712 ** as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT
173718 ExprList *pOrderBy, /* ORDER BY or GROUP BY or DISTINCT clause to check */
173728 u8 isOrderDistinct; /* All prior WhereLoops are order-distinct */
173758 ** We say the WhereLoop is "order-distinct" if the set of columns from
173761 ** order-distinct. A WhereLoop that has no columns in the ORDER BY clause
173762 ** is not order-distinct. To be order-distinct is not quite the same as being
173764 ** are NULL and NULL values are equivalent for the purpose of order-distinct.
173765 ** To be order-distinct, the columns must be UNIQUE and NOT NULL.
173769 ** automatically order-distinct.
173889 ** the loop need to be marked as not order-distinct because it can
174137 ** a DISTINCT operator, M will be the number of distinct output
174149 /* TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT
175065 ** 3) Either the query must be DISTINCT, or else the ON or USING clause
175096 ** SELECT DISTINCT v1, v3 FROM t1
175403 ExprList *pResultSet, /* Query result set. Req'd for DISTINCT */
175610 /* Disable the DISTINCT optimization if SQLITE_DistinctOpt is set via
175615 /* The DISTINCT marking is pointless. Ignore it. */
175618 /* Try to ORDER BY the result set to make distinct processing easier */
175683 /* TUNING: Assume that a DISTINCT clause on a subquery reduces
175688 WHERETRACE(0x0080,("nRowOut reduced from %d to %d due to DISTINCT\n",
175711 sqlite3DebugPrintf(" DISTINCT=unique");
175715 sqlite3DebugPrintf(" DISTINCT=ordered");
175719 sqlite3DebugPrintf(" DISTINCT=unordered");
177791 "DISTINCT is not supported for window functions"
181121 0, /* DISTINCT => nothing */
181391 /* 141 */ "DISTINCT",
181495 /* 245 */ "distinct",
181671 /* 92 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt",
181672 /* 93 */ "oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt",
181677 /* 98 */ "distinct ::= DISTINCT",
181678 /* 99 */ "distinct ::= ALL",
181679 /* 100 */ "distinct ::=",
181768 /* 189 */ "expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP",
181769 /* 190 */ "expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP",
181771 /* 192 */ "expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over",
181772 /* 193 */ "expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over",
181791 /* 212 */ "expr ::= expr IS NOT DISTINCT FROM expr",
181792 /* 213 */ "expr ::= expr IS DISTINCT FROM expr",
182610 242, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
182611 242, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
182616 245, /* (98) distinct ::= DISTINCT */
182617 245, /* (99) distinct ::= ALL */
182618 245, /* (100) distinct ::= */
182707 219, /* (189) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
182708 219, /* (190) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
182710 219, /* (192) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
182711 219, /* (193) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
182730 219, /* (212) expr ::= expr IS NOT DISTINCT FROM expr */
182731 219, /* (213) expr ::= expr IS DISTINCT FROM expr */
183027 -9, /* (92) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
183028 -10, /* (93) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
183033 -1, /* (98) distinct ::= DISTINCT */
183034 -1, /* (99) distinct ::= ALL */
183035 0, /* (100) distinct ::= */
183124 -5, /* (189) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
183125 -8, /* (190) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
183127 -6, /* (192) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
183128 -9, /* (193) expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
183147 -6, /* (212) expr ::= expr IS NOT DISTINCT FROM expr */
183148 -5, /* (213) expr ::= expr IS DISTINCT FROM expr */
183444 case 100: /* distinct ::= */ yytestcase(yyruleno==100);
183741 case 92: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
183746 case 93: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
183772 case 98: /* distinct ::= DISTINCT */
183775 case 99: /* distinct ::= ALL */
184198 case 189: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP */
184204 case 190: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP */
184217 case 192: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist RP filter_over */
184224 case 193: /* expr ::= ID|INDEXED|JOIN_KW LP distinct exprlist ORDER BY sortlist RP filter_over */
184315 case 212: /* expr ::= expr IS NOT DISTINCT FROM expr */
184320 case 213: /* expr ::= expr IS DISTINCT FROM expr */
185707 ** 69: DISTINCT DROP KEY
185880 testcase( i==91 ); /* DISTINCT */
223495 GEODEBUG(("Distinct X: %g\n", pThisEvent->x));
229735 ** considered equal, and NULL is considered distinct from all other values.