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 1m97g8-0000zs-CA for pgsql-performance@arkaria.postgresql.org; Thu, 29 Jul 2021 15:10:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m97g7-00024R-Ax for pgsql-performance@arkaria.postgresql.org; Thu, 29 Jul 2021 15:10:31 +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 1m97g6-000244-UG for pgsql-performance@lists.postgresql.org; Thu, 29 Jul 2021 15:10:31 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m97g3-0004hB-Ky for pgsql-performance@lists.postgresql.org; Thu, 29 Jul 2021 15:10:30 +0000 Received: by mail-io1-xd2f.google.com with SMTP id n19so7690099ioz.0 for ; Thu, 29 Jul 2021 08:10:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/W6cNQ+ioTtLzo0VwXQAJTRhZXDFL2Beu9NT1AHxX88=; b=pv6y/SZ2cYAfjCBcOdDU6nq/7cINDGf1Mi4gbRignHnK/HCuqruTJcFj4/fMRoCfHT XabNuolnCpQjMJqML75mpvQTPCRDZLkiVFFJ+yJQ26+mR9PuSn3XgT6Ayp2VJSUxvmNj /WYUEfVrSBoR/kHMRxjlb69o+AsEDgrDaoRo4BTZulOayhEOCNJCpHlZdTwd8ONAvOUo i57HmD13TcyJvrD45CCjrwh09tuSN9v6B42PmcbRxRy9TFMca3UVxoq4vq4mCbtDcOOL p3ddST6fEcA9gA3pL5mtEbqA96IZcwjbjQZvONq5wbCvbLKFMfspN1Vor1acTq9p8mZf HvfQ== 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:user-agent; bh=/W6cNQ+ioTtLzo0VwXQAJTRhZXDFL2Beu9NT1AHxX88=; b=gkrvwyM0sU5je9NEOFGbPbYHrWNCbRgLfAMTCwvKDrfyhe1Rxs+9OzaicL2QKRPZOB Mmf84e1Rkr0iEE3ciWx1WY+1luMUl7UrI+IP+b4vHchk7RHle/mcpyEyg0qGmIHWqXcw 08xgoRca1qUwAM0djc2PBbbp/GvQoWCryMiRhF0NaBEVBZyxzzcE4omtZODmrJ5D7P4M ivbl8KNwRiqy11R+vYoh2pimJKxQxoG1mkHhVDOGsb/QVYjoyfFsqHtq8vdFt+lV/OdV rpyW7hCCtS64GUDDoaKsIWz6NRN4CZy2EVaDFbDSWMGJzjLH0ZysaOlRvH3PcWcwHPFO ojwQ== X-Gm-Message-State: AOAM533e2swCoAyyMxITYlyYHSihhUW/Kpex82lueF3crduzn0xylv1o ts3rvbS6LIYCeAOuvyXRt2C7Tg== X-Google-Smtp-Source: ABdhPJz3jjCMJrvqpUe+swGKXLEt2chGVbNoFOS8QoIdHoRDeDA26fs8RWrMnCKekY4SOxy6bWNx9Q== X-Received: by 2002:a6b:794b:: with SMTP id j11mr4514821iop.129.1627571425695; Thu, 29 Jul 2021 08:10:25 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id t11sm2058783ilj.63.2021.07.29.08.10.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jul 2021 08:10:25 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 5FCED800C82; Thu, 29 Jul 2021 10:10:24 -0500 (CDT) Date: Thu, 29 Jul 2021 10:10:24 -0500 From: Justin Pryzby To: kenny a Cc: pgsql-performance@lists.postgresql.org Subject: Re: Query performance ! Message-ID: <20210729151024.GF12533@telsasoft.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Please don't cross post to multiple lists like this. Cc: pgsql-sql@lists.postgresql.org, pgsql-performance@lists.postgresql.org, pgsql-general@lists.postgresql.org, pgsql-admin@lists.postgresql.org If you're hoping for help on the -performance list, see this page and send the "explain analyze" for this query. https://wiki.postgresql.org/wiki/Slow_Query_Questions On Tue, Jul 27, 2021 at 05:29:19AM +0530, kenny a wrote: > Hi Experts, > > The attached query is performing slow, this needs to be optimized to > improve the performance. > > Could you help me with query rewrite (or) on new indexes to be created to > improve the performance? > > Thanks a ton in advance for your support.