AVG,COUNT,MIN,MAX,SUM,...
'' => for strings "" => for table/column names
- FROM clause (including any JOIN operations)
- WHERE clause
- GROUP BY clause (if present)
- HAVING clause (if present)
- SELECT clause
- ORDER BY clause
- LIMIT clause (if present)
- Single column
- Multi column
- Unique
- Partial
- Implicit indexes
- Index foreign keys
- Index primary keys and unique columns
- Index on columns that end up in the ORDER BY/WHERE clause
- Don't add an index just to add one
- Don't use on small tables
- Don't use on tables that are update frequently
- Don't use on columns that can contain NULL values
- Don't use on columns that have large values
- B-Tree : default indexing algorithm in Postgres. Best for comparisons with <,<=,=,>=,>, BETWEEN, IN, IS NULL, IS NOT NULL
- Hash : best for equality check
- Gin : best used when multiple values are stored in a single field
- Gist : useful for indexing geometric data and full text search
https://medium.com/yavar/postgres-default-databases-98092224e642
https://www.postgresqltutorial.com/postgresql-administration/postgresql-schema/
https://www.postgresqltutorial.com/postgresql-administration/postgresql-roles/
use --interactive flag for ease
https://www.tutorialspoint.com/postgresql/postgresql_constraints.htm
- NOT NULL
- PRIMARY KEY
- UNIQUE
- CHECK
- REFERENCES
https://www.tutorialspoint.com/postgresql/postgresql_constraints.htm
- PRIMARY KEY
- UNIQUE
- CHECK
- REFERENCES
https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-user-defined-data-types/
