Индексы

Редактировал(а) Alexandr Fokin 2024/05/29 18:53

 PostgreSQL. Индексы
null поля

По умолчанию (SQL) null поле не учитывается ограничении уникальности.
Чтобы добавить проверку уникальности по null значению нужно добавить фильтрующий индекс.

Create unique constraint with null columns
https://stackoverflow.com/questions/8289100/create-unique-constraint-with-null-columns

EntityFramework | EntityFrameworkCore

AreNullsDistinct()
Like запрос

PostgreSQL LIKE query performance variations
https://stackoverflow.com/questions/1566717/postgresql-like-query-performance-variations

11.10. Operator Classes and Operator Families (text_pattern_ops)
https://www.postgresql.org/docs/current/indexes-opclass.html

  
Теги: