On Wed, Oct 11, 2017 at 1:11 PM, Pavel Stehule <pavel.stehule@xxxxxxxxx> wrote: > have you fresh statistics? After upgrade is necessary to run ANALYZE command Yes, that was missing indeed. I did ANALYZE but apparently on all databases but this one. I could have guessed that 1,098,956,679,131,935,754,413,282,631,696,252,928 is not a reasonable cost value. Thanks, Pavel. Best Johannes -- Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance