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 1nbWBS-00013a-Ao for pgsql-sql@arkaria.postgresql.org; Mon, 04 Apr 2022 23:32:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nbWBQ-0000bS-Sv for pgsql-sql@arkaria.postgresql.org; Mon, 04 Apr 2022 23:32:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nbWBQ-0000bJ-Hl for pgsql-sql@lists.postgresql.org; Mon, 04 Apr 2022 23:32:28 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nbWBO-0000cC-Ax for pgsql-sql@lists.postgresql.org; Mon, 04 Apr 2022 23:32:27 +0000 Received: by mail-ej1-x634.google.com with SMTP id yy13so23218264ejb.2 for ; Mon, 04 Apr 2022 16:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OdlIbV3do5yJEpaqziHgxnalYt84dT311VkBs5rrCMg=; b=k9pmj2zBWlIFdMV43fP7BnSno08LAmfZxgXeKWNHJ9riHfAyfyo+rHJdzgvSa16eJo sC+WNqUqqMHD5C72OZvN+HZpFvZI1lbUF+TG3Jm8qTyA0x7iwN+RTiydRWErjOvvSjst RMxBy510LQU9t+qCPiHF3hU6q2ZXUz8uwD8wH18vHg4B+jALIsaKPPgmzmWHT0yZUIR7 /qC6XgK8tOXcPVqB57ST537i+Uaq9jACWiHgxns9oQNLMAX1qFQzeujGYBJAlCnVnyBK sRhgmNRsXwVxhTAs5hORvHsNCy2wvTLXuz9ZUAuTGCNlQBinmMAQuPnzfSEyWJGJ44F+ Rdwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OdlIbV3do5yJEpaqziHgxnalYt84dT311VkBs5rrCMg=; b=lGX4qWggA4u57loD20+w/y7mk05APt+e7gmzk0a7L7ZXHuV7a8HVmpzs9oKmnaSpmX xavFNL1NwaZXqzQ6potKvEceC2d3c1BrVOWGacLSL0QPjhrmBIhvwA8zBn5dHJgU5cCg 0kZxWcw9HPGCc6TsFDbaoSxPMInr9mO1+AbIUHqu9gqnFuQ9OvTuokrZyc/+JzYOQM1p 2z0OZm0uRS9mO9N3EmsggjWrcSmmAPICeJLLnlzcwnxbL2/jJU8Q5rf3XjkP1b4cvgkh IZURZSSaOkDWWHLd6/bW7Vq9y2QhrRTQGKVMunXvl7velh516cc39jQQJE74876qwDkk J03Q== X-Gm-Message-State: AOAM5305Sunyg7feSsWfzR4q8JqHhYKhaCLxHx5PC1NXLhDoWOCCqUz4 gPZSB5JxoH3AfM3H0ZL8bA6Zao2pJDWGqBYojw8= X-Google-Smtp-Source: ABdhPJyVfMyDDDtbo7SRTqH/uM6xKmNuSbegBc6UX/FtTw+4ov4wybv087iKrpivwtqMV6tikp689sSKmGMgaGQBeGs= X-Received: by 2002:a17:907:6093:b0:6e0:dabf:1a9f with SMTP id ht19-20020a170907609300b006e0dabf1a9fmr647083ejc.424.1649115144009; Mon, 04 Apr 2022 16:32:24 -0700 (PDT) MIME-Version: 1.0 References: <3817c56b-458d-5295-e8bc-1001231dc5c8@gmail.com> In-Reply-To: From: "David G. Johnston" Date: Mon, 4 Apr 2022 16:32:12 -0700 Message-ID: Subject: Re: How to just get the last in a recursive query To: Shaozhong SHI Cc: Rob Sargent , pgsql-sql Content-Type: multipart/alternative; boundary="0000000000005a3a2d05dbdc8a6b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000005a3a2d05dbdc8a6b Content-Type: text/plain; charset="UTF-8" On Mon, Apr 4, 2022, 16:21 Shaozhong SHI wrote: > That is not the most efficient in this case. Can you prove that statement? Provide a query that is more efficient. David J. --0000000000005a3a2d05dbdc8a6b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 4, 2022, 16:21 Shaozhong SHI <shishaozhong@gmail.com> wrote:
That is not the most efficient in thi= s case.

Can= you prove that statement?=C2=A0 Provide a query that is more efficient.

David J.
--0000000000005a3a2d05dbdc8a6b--