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 1rnZZC-00DxIZ-5c for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Mar 2024 07:43:54 +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 1rnZZA-0016og-95 for pgsql-bugs@arkaria.postgresql.org; Fri, 22 Mar 2024 07:43:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rnZZA-0016oY-0Q for pgsql-bugs@lists.postgresql.org; Fri, 22 Mar 2024 07:43:52 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rnZZ5-005oHi-6J for pgsql-bugs@lists.postgresql.org; Fri, 22 Mar 2024 07:43:50 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33edbc5932bso1011011f8f.3 for ; Fri, 22 Mar 2024 00:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1711093427; x=1711698227; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=fTIn5IQr38d11EB4dhFCcvAprTYnH4BW8j5HwPRoJYM=; b=KDTApq9IwKvjYSk7a1uTJIIDMr9ZxHjiTswIQCopz8EOp52K3rqvSnOlnEQVpNqkur oDTX76hN0T+Zt74SfCUEcrgnn0K30qzuQ5bWW6FU0bj1q10mdWAsUb4ZofSFxnHUG9jD F4x7iHoYFsFE0oNSy50K8X3/dDyoEucEkN3KyuGkJG5aYIPdN9qWFwgKGUX01Qa01Ccb Mov+HTdP3qRN+QZp2UwL8BS1fk9tE5KanSdyQE+eD9Ja0JlOvwdMKH6ET0y4vyQAsml4 Dr0GxwcX/pCIN6CPrz1nL3VPYnNqFtpnrIqx7McLdcUeyqZMbR8TghFYyg7o3RdCO+RS 7Iow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711093427; x=1711698227; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fTIn5IQr38d11EB4dhFCcvAprTYnH4BW8j5HwPRoJYM=; b=WTmxqdBWYLDg6uzi7nigOn5dlcqI5wEwmKOs6dxvDVcqD6cyS5bHmus0KkDtspdIvO o0C/n4TuxQoud0bkQ7fIQcPTeR/qiY576obeKldGAdPUSvoyzOVQT14mlhNKI+Fhu6xn AJzhO4S1uAc2uV6PF9dKKvbWfQ8MBWGG+VV0doX55eWdi2Md7KB2bhmDBT8VHoP0jIHG vix1XfgANrjtkA4JshNluGUtliBt8LPVNsXhwf2tneXnI2kCckagGdGWekCz5q3uySc4 SOjQxdD7By8+OQ6cGpxdN0+SHZzKfqXm8sJIm/zhWod7jGYyBQZX5hKx9QSsBW7M/nj6 VW6g== X-Forwarded-Encrypted: i=1; AJvYcCVZ0kb5isweeXcRZuO5FWewX579ZezAyV5xusttg1IB8Uh9Xds0VQbrVX3P4rb6agRK86yY4Jsxx8eLY1z5b/0Fd4uTX3J6vrA+oASif2+U X-Gm-Message-State: AOJu0Yzg8G/5KOKQ43Lkp+TGkEpQHNayunHd5pC1UqXoUvBGH3CTQVIO T2g48pqR3uHrYhoNcl55Z6zGRtX89tzylxRTgmw7qaqTb2X4Y3uTF/9iyBNlaw== X-Google-Smtp-Source: AGHT+IHeJ2gw7W+tf1xfZ3gUoAwis/RzZtK5rN/p/KmXDL/gl7fhPBroK8xoV7Oc8YHFW1vDwoud7g== X-Received: by 2002:a5d:5748:0:b0:33e:c0c5:1799 with SMTP id q8-20020a5d5748000000b0033ec0c51799mr815984wrw.45.1711093426582; Fri, 22 Mar 2024 00:43:46 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id bp10-20020a5d5a8a000000b0033dedd63382sm1414862wrb.101.2024.03.22.00.43.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Mar 2024 00:43:46 -0700 (PDT) Message-ID: Date: Fri, 22 Mar 2024 08:43:45 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Index plan returns different results to sequential scan To: Peter Geoghegan Cc: John Burns , pgsql-bugs@lists.postgresql.org References: <3B86F188-F4BF-4331-AD79-E5FF2D0711A3@impactdatametrics.com> <72600f8a-4231-45b7-a116-8ceec5ccf66e@enterprisedb.com> <881DF028-5222-486C-A13B-451239C1316F@impactdatametrics.com> <27496161-e7ec-47bd-b559-3571fde4dcb4@enterprisedb.com> Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/22/24 02:40, Peter Geoghegan wrote: > On Thu, Mar 21, 2024 at 9:22 PM Tomas Vondra > wrote: >> I don't know what the problem is, or whether it's a big in PG or in the >> postcode extension (I agree the extension is fairly straightforward). > > Could you try running amcheck's bt_index_check function against the index? > I tried (on master). It doesn't report anything: test=# select bt_index_check('xxx_postcode_idx', 't'); bt_index_check ---------------- (1 row) I also tried looking at the index using bt_page_items from pageinspect, and I did not notice anything obviously wrong. But I don't have much experience with btree at such low level ... regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company