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 1m1h06-0005eL-VE for pgsql-general@arkaria.postgresql.org; Fri, 09 Jul 2021 03:16:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m1h05-0007Jn-UM for pgsql-general@arkaria.postgresql.org; Fri, 09 Jul 2021 03:16:25 +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 1m1h05-0007J7-Jq for pgsql-general@lists.postgresql.org; Fri, 09 Jul 2021 03:16:25 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m1h03-0005zT-HO for pgsql-general@lists.postgresql.org; Fri, 09 Jul 2021 03:16:25 +0000 Received: by mail-pl1-x62c.google.com with SMTP id j3so2357922plx.7 for ; Thu, 08 Jul 2021 20:16:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=lUuEQP9r9tGyitAGaKetR8c0EThxcfyO1BIsaMfy5y4=; b=vKfZ+qBsaT6t8Qpci56smQM3bzirgPL3xcponX9UzlTVVG2MrmYZukSVWDpCx9sCRp HGe+Hie7t8d3jPbAqsq5H1c9Mld5PRU3pDriXe6A7JVq09sOPuoy6MXo+hOcYEiMzHYC XGX4oIwrZ67g+AOKmEgUqCxzhSVCp8xhnh6vtGav4xQjXiCeIlJKd83QXtdD9+HWc+ai +fUT0CI/Bue/+zRiTZN/mXF5VfqSPd03WfxtkSXu0qF8K8D2QoFoyKQB4l7C1f+xrTP9 aYb2ZiVnRgTS0h/7Dzp8ETeTJUWsZfdEfOXq8h3a1Z5Jgt2SOWpmB7r5+dvtwixryp7F YbiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=lUuEQP9r9tGyitAGaKetR8c0EThxcfyO1BIsaMfy5y4=; b=VpLWw3HEtMjbFrSx/fByFfZnqxAePm7dHYUNPf5ZKi8+NSSMLVL4YcMfd9mqMVKlB+ bt+kbOE5lqa8YDKRt69H/UJqNvnN4ZQV2074vUqnsys8Kp4tIfaFiPz5qy9b4hkMIlMN +6NhFyImIBpETj3GeCbrIQFVGMiGXHMx1qIy+Ru+IzW165IWMoC72FogCDzFljSuaFqa fJahdAYdID+sdGVjJl5+0ZQuKRyppKXr9f/WuJLfwP3EJJIhq53wpyk2x3KpL9FBTLTv pL+UKONMyqA5FU8cXqZPrPHD3bGLwaRqKT/pZ8a5AR3z7afwGvfvtxHW/l7dg6+D0/dB p80A== X-Gm-Message-State: AOAM53365miDat+6ETKerpoHCvO0gMdII66O+xSy32+pYlLigDhxVM0M 4rBNfcz3jFTBuvxsLpYSg5Q= X-Google-Smtp-Source: ABdhPJw+C37pQ1ikZ+rWXGzWYsxOl0SncjVDnL8NL+7gcpzE2NgoVsG+nVJYiipUrErMXiQxGyKHJg== X-Received: by 2002:a17:90a:5306:: with SMTP id x6mr34783332pjh.59.1625800581174; Thu, 08 Jul 2021 20:16:21 -0700 (PDT) Received: from [192.168.1.101] ([203.220.14.162]) by smtp.gmail.com with ESMTPSA id j21sm4181635pfn.35.2021.07.08.20.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 20:16:20 -0700 (PDT) Message-ID: <9f75cdf5e2a33988c54f24fd04e8de486a3e3a49.camel@gmail.com> Subject: Re: optimization issue From: rob stone To: Atul Kumar , pgsql-general Date: Fri, 09 Jul 2021 13:16:16 +1000 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I am curious. NVL, DECODE and SELECT FROM dual are Oracle methods and these appear in your code. How did you make these work in Postgres?  Cheers, Rob