I can't really help, but I can make it more clear
why postgres is choosing a _bitmap_ index scan rather than a
regular index scan. With a regular index scan it pumps the
index for the locations of the rows that it points to and loads
those rows as it finds them. This works great if the rows in
the index are sorta sorted - that way it isn't jumping around
the table randomly. Random io is slow. In a bitmap index scan
pg pumps the index and buffers the by shoving them in a big
bitmap. Then, it walks the bitmap in order to produce in order
io. PG makes the choice based on a measure of the index's
correlation.
The problem comes down to you inserting the
sessions concurrently with one another. My instinct would be
to lower the FILLFACTOR on newly created indecies so they can
keep their entries more in order. I'm not sure why I have
that instinct but it feels right. Also, you might could try
clustering newly created tables on session_id and setting the
fillfactor down so rows with the same session id will stick
together on disk.
Now that I look stuff up on the internet I'm not
sure where I saw that pg tries to maintain a cluster using
empty space from FILLFACTOR but I _think_ it does. I'm not
sure what is going on with my google foo today.
Nik