I can't find where this or the next index are used.  I know that's kind of a difficult thing to do by code review, but it _looks like_ only the pid1 qid1 pid2 context index is used.  My dba kept talking about the number of indexes being a big deal to keep replication happy.