Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMUx9-002XXl-2C for pgsql-general@arkaria.postgresql.org; Thu, 20 Jul 2023 14:48:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qMUx7-009RSh-Hx for pgsql-general@arkaria.postgresql.org; Thu, 20 Jul 2023 14:48:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qMUx7-009RSZ-7d for pgsql-general@lists.postgresql.org; Thu, 20 Jul 2023 14:48:25 +0000 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qMUx3-000fOj-Rv for pgsql-general@lists.postgresql.org; Thu, 20 Jul 2023 14:48:24 +0000 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3fd190065a7so7108355e9.2 for ; Thu, 20 Jul 2023 07:48:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20221208.gappssmtp.com; s=20221208; t=1689864501; x=1690469301; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=koY1vbuJ05Pbtekf5wR0h/UxJn+6/nlsBv6i2LkD2Jc=; b=21cRKiQH6rSIzLCWc8oEUYZalKA4KetZbAi8Hru5Lt8lGvpkQViLgknYAXfgHOPbFv L8MtyXXw2DuorpfFNTvdvIuGaN02I6Iuqo57qx/arD43dMQHD88LvPpUkQxF62vFks+H yv32a9X6peFVSPwfh86+c1p/qaOpSi0NBVjQqa3nOzt8/6nILjiK9E6EWccD/Y04FDui 5Ws1rbI2HTJf0mR739rkagfU7c8TlO376H6AkYQgpijvCqMNu8MVTc4Ck4q1zIL8J1AQ 95EiY/gxg2PIrlKX2FmuTM5T1p18IE4p7xV8D4KzUlp9hyuDf322T/C5ouDPhI3/ALTo APYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689864501; x=1690469301; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=koY1vbuJ05Pbtekf5wR0h/UxJn+6/nlsBv6i2LkD2Jc=; b=QMLox1hD2jWB4Bc7rUoqJhB2ULd15DW/X4G7dI3hdpKYpBuTd73CD+Ab3QssbIKT+5 Oin3/n3vKNvwB6PeFOyrF2im1jqmyeMH0R4yqGVilUoWC99aVgdrg9vFv4D8JjlG5v4n ebaZLFVljhWqgLN2IO5T3iSFPR+UZcZcRppviWUu5oRB9DLtlU1TflhLVfDP+4ISNwrL q8LzegevOr4BG7EvOdpXYQFcBJAZrzxcKG3P3kYzXQZpf6OW6uabFHIauCim4zlWmeuB J8Ieciuwaqd21aaEt1VwlgtzibdrNl//NR7jpvfdhxfsGi0YnK+PbwAZvuZsDJRCneHk nqaA== X-Gm-Message-State: ABy/qLaFY56DmjUp/qGk6PUujRb0spztjjsE34L5JXqRGZPy/fSnxppr RN3sdc6Dswpqn1zbp4IZupmGwUmKNOgaUosm2po= X-Google-Smtp-Source: APBJJlG72pWtianhS6Bn0efivYjGF06y5zmbbzf+N5+kf2IsChxQAEOHF4Rn7b0/wcr0FSKiDwI8sw== X-Received: by 2002:a1c:7710:0:b0:3fc:27:7e46 with SMTP id t16-20020a1c7710000000b003fc00277e46mr7149437wmi.3.1689864500818; Thu, 20 Jul 2023 07:48:20 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:9f9c:795:1a66:3a08:e762]) by smtp.gmail.com with ESMTPSA id y13-20020a05600c364d00b003fbb25da65bsm1350001wmq.30.2023.07.20.07.48.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 07:48:20 -0700 (PDT) Message-ID: Subject: Re: How to improve the performance of my SQL =?UTF-8?Q?query=EF=BC=9F?= From: Laurenz Albe To: gzh Cc: pgsql-general@lists.postgresql.org Date: Thu, 20 Jul 2023 16:48:19 +0200 In-Reply-To: <1937d056.71e9.18973a752d0.Coremail.gzhcoder@126.com> References: <6212ea1b.425b.1897221c3cc.Coremail.gzhcoder@126.com> <369ee851ef59bc84190f1631219b5a0c8f7907e9.camel@cybertec.at> <1937d056.71e9.18973a752d0.Coremail.gzhcoder@126.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2023-07-20 at 22:14 +0800, gzh wrote: > The information I provided is incorrect, please see my previous reply. My question remains: I would like to see the table definitions. Also, did you ANALYZE the tables? Yours, Laurenz Albe