On 7 October 2017 at 2:49 PM, David Rowley wrote: > > Yeah, PostgreSQL does not make any effort to convert subqueries in the > target list into joins. SQL server does.
[...] > You'll probably find it'll run faster if you convert the subquery in > the target list into a join with a GROUP BY, like ... > Wow, David, that is perfect – 0.91 seconds. Problem well and truly solved. It took me a little while to modify my original query to use that concept, but now it flies. Many thanks Frank