Tag sql

15 bookmarks have this tag.

SQL indexes on user-defined functions

use-the-index-luke.com/sql/where-clause/functions/user-defined-functions

Функции должны быть чистыми, чтобы по ним работал индекс

sql

Case-Insensitive Search in SQL

use-the-index-luke.com/sql/where-clause/functions/case-insensitive-search

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.

sql

The right column order in multi-column indexes

use-the-index-luke.com/sql/where-clause/the-equals-operator/concatenated-keys

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.

Например, поиск по имени без фамилии бесполезен. Значит, составной индекс должен начинаться с фамилии, а потом уже будет имя.

sql

Slow Indexes in RDBMS

use-the-index-luke.com/sql/anatomy/slow-indexes

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

Modern SQL: A lot has changed since SQL-92

modern-sql.com

SQL has evolved. Beyond the relational model. Discover it now.

sql

Sort-Merge Join in SQL databases: Oracle, SQL Server, PostgreSQL

use-the-index-luke.com/sql/join/sort-merge-join

Sort-merge joins do not need indexes on the join predicates.
MySQL does not support sort-merge joins at all.

sql

Partial Objects in ORMs: loading a subset of properties

use-the-index-luke.com/sql/join/hash-join-partial-objects

Index the independent where predicates to improve hash join performance.

Indexing join predicates doesn’t improve hash join performance.

Indexing a hash join is independent of the join order.

Select fewer columns to improve hash join performance.

Hash joins do not need indexes on the join predicates. They use the hash table instead.
A hash join uses indexes only if the index supports the independent predicates.
Reduce the hash table size to improve performance; either horizontally (less rows) or vertically (less columns).
Hash joins cannot perform joins that have range conditions in the join predicates.

sql

Tuning SQL LIKE using indexes

use-the-index-luke.com/sql/where-clause/searching-for-ranges/like-performance-tuning

Avoid LIKE expressions with leading wildcards (e.g., '%TERM').

sql

Indexing SQL range conditions less than, greater than and between

use-the-index-luke.com/sql/where-clause/searching-for-ranges/greater-less-between-tuning-sql-access-filter-predicates

Rule of thumb: index for equality first—then for ranges.

sql

LIMIT vs. FETCH in SQL

antonz.org/sql-fetch

Fun fact: There is no limit clause in the SQL standard.

Everyone uses limit.
And yet, according to the standard, we should be using fetch

sql

SQL

grishaev.me/sql

Представьте, какой гемор был бы построить это в Экселе, Гугле или даже на языке программирования вроде Питона. Там с одним только парсингом дат и времени наешься, а тут все из коробки.

sql

Антон Жиянов рассказывает про SQL

podlodka.io/321
podcast,sql

Explaining The Postgres Meme

www.avestura.dev/blog/explaining-the-postgres-meme
database,humour,sql

PRQL

prql-lang.org

PRQL is a modern language for transforming data

Интересная замена SQL. Запросы для аналитики данных станет писать намного проще. Не думаю, что для чего-то другого этот проект подойдёт. Условный CRUD проще написать, используя именно SQL запросы, здесь PRQL излишен.

database,prql,sql

SQL-шпаргалка

antonz.ru/sql-cheatsheet

Для всех, кто знал SQL, но подзабыл

database,programming,sql