On Mon, Apr 08, 2019 at 04:55:36PM +0200, Krzysztof Plocharz wrote: > We did pgrepack and it did help, but is it possible for > get_actual_variable_range to take over 60 seconds? You have many tables being joined, perhaps in exhaustive search, so maybe that's being called many times. What version postgres server ? Justin