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 1qUlvb-00EXiY-8A for pgsql-general@arkaria.postgresql.org; Sat, 12 Aug 2023 10:33:03 +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 1qUlvZ-00GnMA-Ng for pgsql-general@arkaria.postgresql.org; Sat, 12 Aug 2023 10:33:02 +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 1qUkWw-00GBBr-83 for pgsql-general@lists.postgresql.org; Sat, 12 Aug 2023 09:03:30 +0000 Received: from mail.fduerr.de ([161.97.154.227]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qUkWu-0022IC-N2 for pgsql-general@postgresql.org; Sat, 12 Aug 2023 09:03:30 +0000 Received: from [192.168.101.175] (ipbcc02add.dynamic.kabel-deutschland.de [188.192.42.221]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by mail.fduerr.de (Postfix) with ESMTPSA id 02A991200D9; Sat, 12 Aug 2023 11:03:27 +0200 (CEST) Content-Type: multipart/mixed; boundary="------------JGInKnxGv0IJKfDliGjbV0JN" Message-ID: Date: Sat, 12 Aug 2023 11:03:27 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: PgSQL 15.3: Execution plan not using index as expected Content-Language: en-US, de-DE To: rob stone , pgsql-general@postgresql.org References: From: =?UTF-8?Q?D=c3=bcrr_Software?= In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------JGInKnxGv0IJKfDliGjbV0JN Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks Rob, no it's not a problem with the index. It's a problem with the use of CURRENT_USER in the WHERE I submitted a new post on this matter with a test case. Kind regards ====================================== Dürr Software Entw. Guggenberg 26, DE-82380 Peißenberg fon: +49-8803-4899016 fax: +49-8803-4899017 info@fduerr.de Am 12.08.23 um 04:25 schrieb rob stone: > Hello, > >> --------------------------------------------------------------------- >> ------------------------- >>   PostgreSQL 9.3.4 on x86_64-unknown-linux-gnu, compiled by gcc >> (Debian >> 4.8.3-2) 4.8.3, 64-bit >> >> >> --------------------------------------------------------------------- >> ------------------------------------------------ >>   PostgreSQL 15.3 (Debian 15.3-1.pgdg120+1) on x86_64-pc-linux-gnu, >> compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit >> (1 Zeile) >> >> > 9.3 plan > -> Index Scan using client_session_user_id_idx on client_session > > Looks like a collation issue given the difference in compilers used. > In the 9.3 plan the index is used. > Maybe try a reindex of the table. > > HTH, > Rob > --------------JGInKnxGv0IJKfDliGjbV0JN Content-Type: text/vcard; charset=UTF-8; name="info.vcf" Content-Disposition: attachment; filename="info.vcf" Content-Transfer-Encoding: base64 YmVnaW46dmNhcmQNCmZuO3F1b3RlZC1wcmludGFibGU6RnJhbnogRD1DMz1CQ3JyDQpuO3F1 b3RlZC1wcmludGFibGU6RD1DMz1CQ3JyO0ZyYW56DQplbWFpbDtpbnRlcm5ldDppbmZvQGZk dWVyci5kZQ0KdGVsO3dvcms6MDg4MDMtNDg5OTAxNg0KdGVsO2ZheDowODgwMy00ODk5MDE3 DQp0ZWw7aG9tZTowODgwMy00ODkzNzUNCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K --------------JGInKnxGv0IJKfDliGjbV0JN--