[prev] 53 [next]

EXPLAIN examples (cont)

Check your prediction using the EXPLAIN ANALYZE command.

  1. select max(birthday) from People
  2. select max(id) from People
  3. select family from People order by family
  4. select s.family from People s, CourseEnrolments e
    where s.id=e.student and e.grade='FL'
  5. select * from EnrolmentCounts where code='COMP9315';

Examine the effect of adding ORDER BY and DISTINCT.

Add indexes to improve the speed of slow queries.