I've started looking at the patches today, mostly the STIR part. Seems solid, but I've got a question about validation. Why are we still grabbing tids from the main index and sorting them?
I think it's to avoid duplicate errors when adding tuples from STIP to the main index, but couldn't we just suppress that error during validation and skip the new tuple insertion if it already exists?
The main index may get huge after building, and iterating over it in a single thread and then sorting tids can be time consuming.
At least I guess one can skip it when STIP is empty. But, I think we could skip it altogether by figuring out what to do with duplicates, making concurrent and non-concurrent index creation almost identical in speed (only locking and atomicity would differ).
p.s. I noticed that `stip.c` has a lot of functions that don't follow the Postgres coding style of return type on separate line.