June 2024
Intermediate to advanced
456 pages
11h 34m
English
One of the best ways to learn about PostgreSQL is to conduct experiments on databases with large tables. For specific queries, you can then iterate on different index types, varying their definitions to cover different columns, orderings, and index options. Using the query planner, you can verify that the candidate indexes have the intended benefit or discard them.
Let’s explore that process. Create a temp schema locally if one doesn’t exist already from earlier work. Add a users table to the temp schema. Insert a large amount of rows into temp.users; ten million should do it! Run the following statements from psql to do that:
| | CREATE SCHEMA IF NOT EXISTS temp; |
| |
Read now
Unlock full access