Gerardo Herzig wrote:
> -> Seq Scan on pages (cost=0.00..9.08 rows=408 width=55)
> Watch the last row of the explain command. It makes a sequential scan on
> the pages table, like it is not using the index on the "id" field.
You only have 408 rows in the table - it's probably not worth the
trouble of using an index and *then* fetching the rows. Especially since it's going to match most of the pages
anyway.
Try adding a few thousand rows, analyse and see if it decides to use the
index then.
-- Richard Huxton Archonet Ltd