Bookmarks for 2023-11-16
5 bookmarks were saved this day.
5 bookmarks were saved this day.
Функции должны быть чистыми, чтобы по ним работал индекс
Using UPPER or LOWER for case-insensitive search is not a good practice. Prefer using a _CI collation if possible or at least add the right indexes to make your query fast.
The most important consideration when defining a concatenated index is how to choose the column order so it can be used as often as possible.
Например, поиск по имени без фамилии бесполезен. Значит, составной индекс должен начинаться с фамилии, а потом уже будет имя.
An index lookup requires three steps: (1) the tree traversal; (2) following the leaf node chain; (3) fetching the table data. The tree traversal is the only step that has an upper bound for the number of accessed blocks—the index depth. The other two steps might need to access many blocks—they cause a slow index lookup.
SQL has evolved. Beyond the relational model. Discover it now.