Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLZTl-0004aN-I4 for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2020 21:40:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jLZTk-0002sr-4h for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Apr 2020 21:40:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jLZTj-0002sj-UF for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2020 21:40:23 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jLZTc-0005bG-Q7 for pgsql-hackers@lists.postgresql.org; Mon, 06 Apr 2020 21:40:23 +0000 Received: by mail-wr1-x441.google.com with SMTP id v5so1278592wrp.12 for ; Mon, 06 Apr 2020 14:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RXyorZA4pAN6UR+X1Cczl8h/2irg9w0DxdAR3yVo7Jc=; b=SBcawV/Smxiz463pMNigsuXbVTsrPouLuD0YPLzAS44KXPOc7OSjRAn4wl8sHniR5T 1i6oDF/DMFx2W5YAIYIrKbiB+PZJSfH8ahM2OV8zegh2vKlOSgZaAHQQw8dCgEpMsN72 V2/37NEqIsBiIr4ic/Zg+ZZ9xTDTPbM3w4AxoH4dUPnkXRII2xAlUDoHD6tQfJMEr3nb ELGZurpNDtgb2JEd1ZpfX7MG3ENNSfhWtXnUorZDGr0u8ukNsnV2WWSLRX9cFYw6/gku RSuvrO6OLmWY9oiVVRdVxSgCkIJdBq+PtunJflxeC6Qw60AeGoeK0iKhVNp/xSNbhYiS TIrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RXyorZA4pAN6UR+X1Cczl8h/2irg9w0DxdAR3yVo7Jc=; b=DSF5xi+9IiuLJIo4TbkMIf6lmRvqaD5k/0GljtMQWNf3mZarPbUUhLCaDU490oN4Lc LnPTm31/sqb7P9gs72AcCHYTyb5UXEHYuktM+qqmFWVijEJCvZ9x6Ewkao1yEmMiN21G KH90jJ7Z2EdLV2Z0WjoQtid8n9vcxu3nXTGhtN4F3GuDfIH2EZ1+GWOMUr+hYEzT2zr9 VBONouTRbzqCkcCsmoiY4FX4Us4A3M2vv/4hIOGxu2Nk2kB6a2dRGfVqbMQyMOrVGz/M nF7Xo7sEZcnUDOiyQk+2AqZsHCArFPOGqm40d3r83VwRREg9/ishgxQggVX5R12H0cm4 9pnA== X-Gm-Message-State: AGi0PuaCdpcEdKsz2GS1jSZW2FERQWo4y9BGtMf+6MILWR10WGPL22S6 GNsmh76JzRtTT32CwiZt7A0EtA== X-Google-Smtp-Source: APiQypJw7TOufplT1ghMafJL1GOEPyy4vy36kdYgMJwaZztTdt/B9QCOAVjFFfzSmhOHxM2wm3EC4w== X-Received: by 2002:a5d:5226:: with SMTP id i6mr1275118wra.257.1586209215836; Mon, 06 Apr 2020 14:40:15 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id u16sm27732156wro.23.2020.04.06.14.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 14:40:15 -0700 (PDT) Date: Mon, 6 Apr 2020 23:40:13 +0200 From: Tomas Vondra To: Alvaro Herrera Cc: Tom Lane , James Coleman , Michael Paquier , Rafia Sabih , Peter Geoghegan , Simon Riggs , Shaun Thomas , Dmitry Dolgov <9erthalion6@gmail.com>, Alexander Korotkov , PostgreSQL Developers , Andreas Karlsson Subject: Re: [PATCH] Incremental sort (was: PoC: Partial sort) Message-ID: <20200406214013.anocumcau5qvuim4@development> References: <19920.1586206115@sss.pgh.pa.us> <20200406205438.GA30063@alvherre.pgsql> <20200406211232.35s2gmygrfx3ljrj@development> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200406211232.35s2gmygrfx3ljrj@development> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, Apr 06, 2020 at 11:12:32PM +0200, Tomas Vondra wrote: >On Mon, Apr 06, 2020 at 04:54:38PM -0400, Alvaro Herrera wrote: >>On 2020-Apr-06, Tom Lane wrote: >> >>>Locally, things pass without force_parallel_mode, but turning it on >>>produces failures that look similar to rhinoceros's (didn't examine >>>other BF members). >> >>FWIW I looked at the eight failures there were about fifteen minutes ago >>and they were all identical. I can confirm that, in my laptop, the >>tests work without that GUC, and fail in exactly that way with it. >> > >Yes, there's a thinko in show_incremental_sort_info() and it returns too >soon. I'll push a fix in a minute. > OK, I've pushed a fix - this should make the buildfarm happy again. It however seems to me a bit more needs to be done. The fix makes show_incremental_sort_info closer to show_sort_info, but not entirely because IncrementalSortState does not have sort_Done flag so it still depends on (fullsortGroupInfo->groupCount > 0). I haven't noticed that before, but not having that flag seems a bit weird to me. It also seems possibly incorrect - we may end up with fullsortGroupInfo->groupCount == 0 prefixsortGroupInfo->groupCount > 0 but we won't print anything. James, any opinion on this? I'd say we should restore the sort_Done flag and make it work as in plain Sort. Or some comment explaining why depending on the counts is OK (assuming it is). regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services