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 1lNH6j-0001XP-2R for pgsql-general@arkaria.postgresql.org; Fri, 19 Mar 2021 15:32:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lNH6i-0008KD-03 for pgsql-general@arkaria.postgresql.org; Fri, 19 Mar 2021 15:32:12 +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 1lNH6h-0008K6-Id for pgsql-general@lists.postgresql.org; Fri, 19 Mar 2021 15:32:11 +0000 Received: from mail1.dalibo.net ([212.83.143.11] helo=mail.dalibo.com) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNH6e-0005c6-Lh for pgsql-general@lists.postgresql.org; Fri, 19 Mar 2021 15:32:11 +0000 Received: from firost (larco.ioguix.net [82.66.0.6]) by mail.dalibo.com (Postfix) with ESMTPSA id AD87A1FE8A; Fri, 19 Mar 2021 16:32:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dalibo.com; s=a; t=1616167926; bh=xhpfvO3Npk6G+pF1GOG/OiRjTZUBVGicFvfPchNgvQ0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=biM63Hzd6pd3Esdp2DBJT3AXR0CfdXIZ+LwvbGfjx9a1DWzQcc5vvRw8+HnThbIok eCiw58f4a2AF3WHKap6bwGBgs9CG+M8fVb9df3ZKwUREw8BfW9lh7ltE0EKvB6Snpq 1qK98K6f6l4oFxYS8X9oxH7Y67Uq2maDcSuNzplY= Date: Fri, 19 Mar 2021 16:32:05 +0100 From: Jehan-Guillaume de Rorthais To: Frank Millman Cc: pgsql-general@lists.postgresql.org Subject: Re: SELECT is faster on SQL Server Message-ID: <20210319163205.2b86c71d@firost> In-Reply-To: References: <33b19e80-75da-a455-7e78-a01e14e4d4d6@gmx.net> <5a6f07d7-1d0f-f685-6743-d4dbc1730177@chagford.com> Organization: Dalibo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 19 Mar 2021 14:28:27 +0200 Frank Millman wrote: > [...] > Execution of my main query has improved from 50ms to 33ms. Sql Server=20 > takes 25ms, but this is much better than it was. >=20 > [...] >=20 > Here is the new EXPLAIN ANALYSE - >=20 > QUERY PLAN > -------------------------------------------------------------------- > =C2=A0Merge Left Join=C2=A0 (...) (actual time=3D1.566..1.581 rows=3D5 l= oops=3D1) 1.581ms to output the very last row of this plan. This is in contradiction = with the 33ms you are referencing above. What do I miss here? Maybe your 33ms comes yet from another set of data? Co= uld you share an explain analyze actually showing this 33ms total execution tim= e?