/ Check-in [cf41d6a0]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix a code comment in select.c. No code changes. (CVS 4539)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: cf41d6a00f658d2cd64ff9811a3b1270ad1a580b
User & Date: danielk1977 2007-11-12 15:40:42
Context
2007-11-12
17:56
Another attempt at fixing a memory leak in the TCL interface. See check-in (4338) for the first attempt. Ticket #2597. (CVS 4540) check-in: 68a43c99 user: drh tags: trunk
15:40
Fix a code comment in select.c. No code changes. (CVS 4539) check-in: cf41d6a0 user: danielk1977 tags: trunk
15:29
Where possible, transform the DISTINCT qualifier to a GROUP BY clause. GROUP BY clauses may be optimized by indices, DISTINCT qualifiers cannot. (CVS 4538) check-in: e5633123 user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/select.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains C code routines that are called by the parser
    13     13   ** to handle SELECT statements in SQLite.
    14     14   **
    15         -** $Id: select.c,v 1.360 2007/11/12 15:29:19 danielk1977 Exp $
           15  +** $Id: select.c,v 1.361 2007/11/12 15:40:42 danielk1977 Exp $
    16     16   */
    17     17   #include "sqliteInt.h"
    18     18   
    19     19   
    20     20   /*
    21     21   ** Delete all the content of a Select structure but do not deallocate
    22     22   ** the select structure itself.
................................................................................
  3063   3063     if( pParent && pParentAgg &&
  3064   3064         flattenSubquery(db, pParent, parentTab, *pParentAgg, isAgg) ){
  3065   3065       if( isAgg ) *pParentAgg = 1;
  3066   3066       goto select_end;
  3067   3067     }
  3068   3068   #endif
  3069   3069   
  3070         -  /* If possible, rewrite the query to use GROUP BY instead of 
         3070  +  /* If possible, rewrite the query to use GROUP BY instead of DISTINCT.
         3071  +  ** GROUP BY may use an index, DISTINCT never does.
  3071   3072     */
  3072   3073     if( p->isDistinct && !p->isAgg && !p->pGroupBy ){
  3073   3074       p->pGroupBy = sqlite3ExprListDup(db, p->pEList);
  3074   3075       pGroupBy = p->pGroupBy;
  3075   3076       p->isDistinct = 0;
  3076   3077       isDistinct = 0;
  3077   3078     }