copy_plain and copy_indexed are empty tables with the same columns as visits. copy_plain has no index. copy_indexed has four indexes. visits has an index on ms, and members has an index on email.
Each statement in the Result tab shows how many milliseconds it took.
- Copy every row of
visitsintocopy_plain. - Copy every row of
visitsintocopy_indexed. - Which table took longer to fill?
- Show the plan of
SELECT * FROM visits WHERE ms > 100. About 96 % of the visits match. Does the plan usevisits_ms_idx? Answer yes or no. - Show the plan of
SELECT * FROM members WHERE lower(email) = 'user77@example.com'. - Make that plan use an index. Then show the plan again.