[snip] > Come to think of it, an auto-reindex option might be nice in core someday. > TODO item? Marry it with autovacuum + online index build, and it will be cool ;-) BTW, having a privileged background thread doing the reindex could be a solution to most of the objections regarding online reindex, as the thread would be privileged enough already to be able to back out if something fails (part of the objections), and it could stay around long enough to only lock tentatively in a loop in order to avoid deadlocks (another part of the objections). If it would be also marked the same as the vacuum threads not to block other vacuums, then it would also not be a problem that it runs 2 days... Cheers, Csaba.