When indexes don't help
Në shqip: Kur indekset s'ndihmojnë
ShpjegimiSQ
Indeksi s'përdoret kur query-ja kthen shumicën e rreshtave, kur kolona ka pak vlera të ndryshme (p.sh. gjinia), ose kur mbështjell kolonën me funksion (WHERE LOWER(email) = ...). Atëherë duhet një indeks mbi shprehjen.
EnglishEN
An index isn't used when the query returns most rows, when the column has few distinct values (e.g. gender), or when you wrap the column in a function (WHERE LOWER(email) = ...). Then you need an index on the expression.
Si ta mendosh
Si një indeks libri për fjalën „dhe“ — do të të çonte në çdo faqe.
Lexoje në anglisht
Like a book index entry for the word “and” — it would point to every page.
Shembull kodisql
CREATE INDEX idx_email_lower ON perdoruesit (LOWER(email));