For the record, I ran vacuumdb and observed this monstruous query on the index page of Bookmarks:
select count(*) from bm_bookmarks
where owner_id = :viewed_user_id
and folder_p = 't'
and acs_permission__permission_p(bookmark_id, :browsing_user_id, 'write')
The query went from 6 to 4 seconds, not quite the improvement I had hoped for. Vacuumdb does make a significant difference though and I'll start doing it nightly. Admittedly, the server has an old AMD 400 MHZ something processor. I have plenty of ram though, according to top about 290 MB free.
Don, could you send me the db -cache code. I'd be very curious to see if I could use it.
Thanks!
/Peter