The following bug has been logged on the website:
Bug reference: 15008
Logged by: Laurent Martelli
Email address: martellilaurent@gmail.com
PostgreSQL version: 9.6.6
Operating system: Debian 9.3
Description:
I have a set of scripts I execute with psql, and for some reason, a query in
one of them take forever (never had the patience to wait for more than 15
minutes), eating 1 CPU, unless I insert a pause (sleep 60) before that
script, and then it only takes a few seconds.
It only occurs when the tables we operate on have a sufficient number of
rows. When we do "unit" tests with a subset of the data, it all goes
smoothly.
Please, tell me what additional information I can provide to help fix this.