Pages generator performance

Never load whole pages table into memory.

Still have good performance by adding various other caches but cache only tiny bits:

* single row including all parent_ids and parent visible (cacheid = id)
* child ids (cacheid = id)
* id by filename (cacheid = parent id + filename)