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 1tDJov-00HSji-UZ for pgsql-general@arkaria.postgresql.org; Tue, 19 Nov 2024 08:42:49 +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 1tDJot-00BVF7-TQ for pgsql-general@arkaria.postgresql.org; Tue, 19 Nov 2024 08:42:48 +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 1tDJot-00BVBx-F1 for pgsql-general@lists.postgresql.org; Tue, 19 Nov 2024 08:42:48 +0000 Received: from mail.evolu-s.it ([77.81.232.174]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tDJor-002iLi-WE for pgsql-general@lists.postgresql.org; Tue, 19 Nov 2024 08:42:47 +0000 dkim-signature: v=1; a=rsa-sha256; d=evolu-s.it; s=dkim; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:MIME-Version:Content-Type:Content-Transfer-Encoding:In-Reply-To:References; bh=pDnkFOU3DNFkvtz3VcFrAht994Y6t8R2Pw7MXt3gCpc=; b=ElzCBX9M2+lJuK8uKFgxP64lAgkPQ1SyroQmbSm3Re3uk/c4bbU+laCVwKJ7s5+pv6aaPqferUTMeDG3QVnXZchaXvI0fRH6Gb1NUAeZj7MEKLLQ2P0amSu9tpJtfyEWJkODGaA4Ih1zk8bKdjn6gMoNJ4YsmfGUYzZ55sLc/S8= Received: from [192.168.1.103] (res-129401d.ppp.twt.it [83.217.179.105]) by mail.evolu-s.it with ESMTPSA (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128) ; Tue, 19 Nov 2024 09:42:44 +0100 Message-ID: <145e1c71-c0c6-473d-bc89-86cbd106b58b@evolu-s.it> Date: Tue, 19 Nov 2024 09:42:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Functions and Indexes To: pgsql-general@lists.postgresql.org References: <2e36a2fe-b30f-46a5-937f-3b7d94e75cb6@evolu-s.it> <8dfd0bd5-87e5-4de7-9f60-8a680a32bc11@evolu-s.it> <20241118144307.2017e712@exelion> Content-Language: en-US, it From: Moreno Andreo In-Reply-To: <20241118144307.2017e712@exelion> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 18/11/24 15:43, Gianni Ceccarelli wrote: > On Mon, 18 Nov 2024 15:37:57 +0100 > Moreno Andreo wrote: > >> If a column appears in the WHERE clause (and so it should be placed >> in index), in case it is "processed" in a function (see below), is it >> possible to insert this function to further narrow down things? > You probably want to look at > https://www.postgresql.org/docs/current/indexes-expressional.html > Hi Gianni,     correct. That's a good starting point (now I have to add complexity since the index should have 4 columns, one of them is referenced with LIKE) Thanks! Moreno