Re: Index

From: Tony Mountifield <tony_at_mountifield.org>
Date: Sun, 21 Jul 2019 19:22:19 +0000 (UTC)
Message-ID: <qh2e1b$iab$1_at_softins.softins.co.uk>


[Quoted] In article <qh2bl2$9ii$3_at_dont-email.me>, The Natural Philosopher <tnp_at_invalid.invalid> wrote:
> On 21/07/2019 09:35, Axel Schwenke wrote:
> > On 19.07.2019 23:25, mmmmvh_at_gmail.com wrote:
> >>
> >> select * from table where name = "Erick" and month = "10"
> >>
> >> Is it faster if I have an index to name and another index to month?
> >> Is it more convenient to have a single index (name, month)?
> >
> > For this(!) query an index on (name, month) will be the best. Read: this
> > index will give you the fastest query execution.
> >
> > As others already said, MySQL will use only one index (at least for this
> > type of query, RTFM for details). An index on (name) would be more selective
> > than an index on (month). The combined index on (name, month) will yield
> > only hits for the above query. And it could be used just like an index on
> > (name) alone (the "index prefix" rule, again: RTFM).
> >
> > There are however drawbacks from this strategy of adding "perfect" indexes
> > for your queries. For one there is a limit of 64 indexes per table. Then
> > indexes need space, both on disk and in memory. And finally indexes need
> > maintenance whenever data is modified (rows inserted/deleted/altered).
> >
> The plural of index is indices.

From grammarist.com:



Indexes vs. indices

[Quoted] Indexes and indices are both accepted and widely used plurals of the noun index. Both appear throughout the English-speaking world, but indices prevails in varieties of English from outside North America, while indexes is more common in American and Canadian English. Meanwhile, indices is generally preferred in mathematical, financial, and technical contexts, while indexes is relatively common in general usage.

[Quoted] Neither form is wrong. Both have been in English many centuries (and though indexes is now most common in American English, it predates the United States by centuries). It’s true that indices is the plural of index in Latin, but index is an English word when English speakers use it—and it is a longstanding one at that—so we can pluralize it according to the conventions of English.


I tend to use indices in mathematics and indexes in databases.

Cheers
Tony

-- 
Tony Mountifield
Work: tony_at_softins.co.uk - http://www.softins.co.uk
Play: tony_at_mountifield.org - http://tony.mountifield.org
Received on Sun Jul 21 2019 - 21:22:19 CEST

Original text of this message