OK, thanks.
Do you mean that is only valid if there are no rows where all columns are
NULL?
In any case, I can see that this optimization (in SQLite) is just not worth
the trouble.

RBS


On Fri, Oct 2, 2015 at 6:02 PM, Richard Hipp <drh at sqlite.org> wrote:

> On 10/2/15, Bart Smissaert <bart.smissaert at gmail.com> wrote:
> >
> > Unless I am mistaken here this is done with a SQL like this:
> >
> > SELECT COUNT(*) AS UNIQUE_ROWS
> > FROM (SELECT DISTINCT * FROM TABLE1)
> >
> > But if we take advantage of the fact that this table has a unique index
> on
> > all the fields of the table
> > we can simply do this SQL:
> >
> > SELECT COUNT(*) FROM TABLE1
> >
>
> No.  That is only valid if all columns are individually NOT NULL.
>
> --
> D. Richard Hipp
> drh at sqlite.org
> _______________________________________________
> sqlite-users mailing list
> sqlite-users at mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>

Reply via email to