On Tue, Aug 13, 2019 at 1:58 PM Michael Paquier <mich...@paquier.xyz> wrote: > On Sun, Aug 11, 2019 at 03:59:06PM -0400, Tom Lane wrote: > > I hacked temp.sql to print a couple different plans (doing it that way, > > rather than manually, just to ensure that I was getting plans matching > > what would actually happen right there). And what I see, as attached, > > is that IOS and plain index and bitmap scans all have pretty much the > > same total cost. The planner then ought to prefer IOS or plain on the > > secondary grounds of cheaper startup cost. However, it's not so hard > > to believe that it might switch to bitmap if something caused the cost > > estimates to change by a few percent. So probably we should write this > > off as "something affected the plan choice" and just add the ORDER BY > > as you suggest. > > That matches what I was seeing, except that I have done those tests > manually. Still my plans matched with yours.
Here's another one that seems to fit that pattern. https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=skink&dt=2019-08-11%2007%3A33%3A39 +++ /home/andres/build/buildfarm/HEAD/pgsql.build/src/bin/pg_upgrade/tmp_check/regress/results/collate.icu.utf8.out 2019-08-11 08:29:11.792695714 +0000 @@ -1622,15 +1622,15 @@ SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND typname <> 'INT2'::text COLLATE case_insensitive; typname --------- - int4 int8 + int4 (2 rows) -- Thomas Munro https://enterprisedb.com