Adding the patch mentioned in another thread [1], as a bugfix to the patch creating two indexes on list_threads(listid)
[1] https://www.postgresql.org/message-id/4999fcd4-7b9e-3d25-42fa-1b322c3867a0%40cmatte.me-- Célestin Matte