[mythtv-users] Duplicate detection

Gary Buhrmaster gary.buhrmaster at gmail.com
Sat Sep 24 16:45:36 UTC 2016


On Sat, Sep 24, 2016 at 3:14 PM, Mike Perkins
<mikep at randomtraveller.org.uk> wrote:

> If the field you choose to select on hasn't got an index then the query has
> to read the entire table to find out which records it might need; with an
> index, it just reads the index - which is already sorted into an order the
> query can make use of.

Maybe.  It depends on the engine optimizer which
execution plan is selected, (usually) based on the
statistics of the data.  It is sometimes faster to do
a table scan than an index match.  And indexes
can actually be harmful in some cases.  With most
databases, one can use the "explain" syntax to
determine what the engine selects for its execution
plan, and some engines can support hints as to
which execution plan to select (because sometimes
the engine just gets it very wrong).

As with much else, the details matter, and
generalizations never count for your particular
use case.


More information about the mythtv-users mailing list