Lines Matching refs:sort

2388 ** to help with sort operations when multithreaded sorting
2411 ** Usually, when SQLite uses an external sort to order records according
8926 ** <dd>^This is the number of sort operations that have occurred.
10023 ** sort order defined by the "nOrderBy" and "aOrderBy" fields of the
17640 ** A sort order can be either ASC or DESC.
17644 #define SQLITE_SO_UNDEFINED -1 /* No sort order specified */
17984 #define KEYINFO_ORDER_DESC 0x01 /* DESC sort order */
18023 KeyInfo *pKeyInfo; /* Collation and sort-order information */
53370 ** corrupted by this sort.
55256 ** on pRowSet->pEntry, then sort those entries into the forest at
55273 /* Only sort the current set of entries if they need it */
64984 ** aLeft[] and aRight[] are arrays of indices. The sort key is
65005 const u32 *aContent, /* Pages in wal - keys for the sort */
65045 ** Sort the elements in list aList using aContent[] as the sort key.
65064 ht_slot *aList, /* IN/OUT: List to sort */
65147 ht_slot *aTmp; /* Temp space used by merge-sort */
65168 /* Allocate temporary space used by the merge-sort routine. This block
76954 ** An O(N*N) sort algorithm is used, but since N is never more than NB+2
86723 rc = -rc; /* Invert the result for DESC sort order. */
92679 ** P4 is a KeyInfo structure that defines collating sequences and sort
92683 ** The comparison is a sort comparison, so NULLs compare equal,
92697 int bRev; /* True for DESCENDING sort order */
94778 ** a transient index that is specifically designed to sort large
94779 ** tables using an external merge-sort algorithm.
94782 ** assume that a stable sort considering the first P3 fields of each
99789 ** a VdbeCursor to sort large numbers of keys for CREATE INDEX statements
99793 ** The VdbeSorter object implements a multi-threaded external merge sort
99850 ** an in-memory merge sort. In this case, no temporary files are required
99940 typedef struct SortSubtask SortSubtask; /* A sub-task in the sort process */
100040 ** This object represents a single thread of control in a sort operation.
100691 ** is non-zero and the sorter is able to guarantee a stable sort, nField
100695 ** of the records being sorted. So if the sort is stable, there is never
100699 ** The sorter can guarantee a stable sort when running in single-threaded
101082 sqlite3 *db, /* Database handle doing sort */
101487 /* Select a sub-task to sort and flush the current list of in-memory
102198 VdbeSorter *pSorter, /* The VDBE cursor that implements the sort */
102367 ** sort the VdbeSorter.pRecord list. The vdbe layer will read data directly
105024 ** as an indication to the caller that it should sort by the i-th column.
107734 ** Set the sort order for the last element on the given ExprList.
108184 ** in pGroupBy that sort with the BINARY collation sequence.
121766 ** sort orders.
131343 return 0; /* Different sort orders */
138923 ** (2) All output columns are included in the sort record. In that
138925 ** (3) Some output columns are omitted from the sort record due to
139321 ** values for any expressions that are also part of the sort-key are omitted
139398 ** expression within the sort-key that pushOntoSorter() will generate.
145784 ** we do not have to sort. The OP_OpenEphemeral table will be
145836 VdbeComment((v, "GROUP BY sort")); VdbeCoverage(v);
145840 /* If the index or temporary table used by the GROUP BY sort
146108 /* If there is an ORDER BY clause, then we need to sort the results
151450 u16 nDistinctCol; /* Index columns used to sort for DISTINCT */
153709 ** a non-default "big-null" sort (either ASC NULLS LAST or DESC NULLS
153712 ** it is not. For an ASC sort, the non-NULL entries are scanned first.
159289 ** the right column of the right source table. And that the sort
159290 ** order of the index column is the same as the sort order of the
160890 ** (or GROUP BY) without requiring a separate sort operation. Return N:
160914 u8 rev; /* Composite sort order */
160915 u8 revIdx; /* Index sort order */
161101 /* Get the column number in the table (iColumn) and sort order
161160 /* Make sure the sort order is compatible in an ORDER BY clause.
161282 /* TUNING: Estimated cost of a full external sort, where N is
161283 ** the number of rows to sort is:
161302 ** Use the LIMIT for M if it is smaller. Or if this sort is for
161309 /* TUNING: In the sort for a DISTINCT operator, assume that the DISTINCT
161466 ("---- sort cost=%-3d (%d/%d) increases cost %3d to %-3d\n",
161471 rUnsorted -= 2; /* TUNING: Slight bias in favor of no-sort plans */
162696 ** optimizations. We need to do an actual sort for RIGHT JOIN. */
165208 ** If the sort-order for the ORDER BY term in the window is DESC, then the
165211 ** ">" becomes "<", and so on. So, with DESC sort order, if the argument op
179619 u8 bDesc; /* True to sort in descending order */
191631 /* If more than one term matches the prefix, sort the Fts3HashElem
191779 Fts3SegReader **apSegment, /* Array to sort entries of */
192650 ** unnecessary merge/sort operations for the case where single segment
192794 ** forward. Then sort the list in order of current term again.
203320 /* Check that the sort worked */
203385 /* Check that the sort worked */
208295 ** One way to improve the situation is to sort the operations on each index
214248 ** sort-order than its child page:
214448 ** SQLite does not do an external sort.
237686 ** (in the cursors sort order - ASC or DESC) than the current rowid.