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 1lEspF-00073C-TV for pgsql-general@arkaria.postgresql.org; Wed, 24 Feb 2021 11:59:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEspE-0006SU-KE for pgsql-general@arkaria.postgresql.org; Wed, 24 Feb 2021 11:59:28 +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 1lEspE-0006Ru-Cr for pgsql-general@lists.postgresql.org; Wed, 24 Feb 2021 11:59:28 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lEsp7-0007HK-Iq for pgsql-general@lists.postgresql.org; Wed, 24 Feb 2021 11:59:27 +0000 Received: by mail-ej1-x635.google.com with SMTP id g5so2613246ejt.2 for ; Wed, 24 Feb 2021 03:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=2M6goFVyfLCPwWTfpQ9fZWULNd0/1ZB15jcqM5L0a+A=; b=H1b3HPzr36EjOIMUiyR7UlgGEJQ/w+k9CK7Rir6ZJoZuqQ0rO2f9lVibKslL3ctso1 CtNk2x7qqqhBmcVF8tUzCdQiFrDHLURpDXgNuwSbw31JtibsRzd7fWkZdDcwpzGPeZGT MjltmJDsDCWVXnSto6O4LdLFg0Rgw8sQl65hOYuITXTpy2+YdLNzscNOv8dqQqJZkqYv zwQCO+DP4yDuWu5F6Y7mizfjQ8Av+/rgVi3YkLkWE1bWGRDXsZ1EWwzcF//wlGQQ+IG3 yEnNsUP8vZmMMcEqMjrFGkjMe7zjS7WLwplfBMQXth+DD8pC2GVsbpv1OOGJKvhAqt/x UIKQ== 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=2M6goFVyfLCPwWTfpQ9fZWULNd0/1ZB15jcqM5L0a+A=; b=M7c3WIBhpLKpkAgp9VTPBwxoz+XpchKCvlfozGP79/dzHcwVwSXgMIS6jvTNoPntn8 GMZsHT40wnP1awOs3gJxdwLhbqI6yRxu9JUXkeCxJ8Jj1qr7Dd656PnpquGmOV0m46yE mpLiFeE8mLbQs7rt3TOx2hOdlO45ubATn+12f953CaaxkBG+Id4yrwJ41vCkB024WAMk IdX/d4KpmZsroaY6D5Pv9OnlClrN5wZ7ORXPLKhkZUOQjMuZwhKrGt3r5MOrYe2iUkfg sFrovOWMkAghOUux9V+VP+yjq/g3YVfsPkYi7EBsGHdvXqxqW5EFwxCLLocgCtEvfTes mt8A== X-Gm-Message-State: AOAM530hvz6oyVdgRiQ62MvAtmStATlOeZi/mucYre2fOL/jSAgTAKAt j4H4Ls/rQu6kbwaNJ/zb7HIIhQ== X-Google-Smtp-Source: ABdhPJw7cwaj0aQZ780K5ji5V03x36FM+RSXYXfckeFf+CjGgUSnBXp5h5RCBMdZwiRyU5Y3D6VRaA== X-Received: by 2002:a17:907:770d:: with SMTP id kw13mr31097039ejc.219.1614167959399; Wed, 24 Feb 2021 03:59:19 -0800 (PST) Received: from localhost.localdomain (217-149-171-252.nat.highway.telekom.at. [217.149.171.252]) by smtp.gmail.com with ESMTPSA id a26sm1466334edm.15.2021.02.24.03.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 03:59:19 -0800 (PST) Message-ID: Subject: Re: Different query result, maybe bad index From: Laurenz Albe To: =?ISO-8859-1?Q?V=E1clav?= Steiner , pgsql-general@lists.postgresql.org Date: Wed, 24 Feb 2021 12:59:18 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, 2021-02-24 at 12:50 +0100, Václav Steiner wrote: > We have three servers running postgres 9.6, master and two slaves feeded by streaming replication. > On of those slaves we are getting different query results. The replica was recreated from scratch, but problem persists. > > If set enable_indexscan='off' and set enable_bitmapscan='off' we get correct result. > It looks like problem with some index...? > > Can anybody saw such behaviour? If the problem persist when you rebuild the standby, I suspect that the servers are running different C libraries or C library versions, so that the collations with the same name behave slightly differently. That could lead to the observed behavior with indexes on string data types. Make sure to use the same C library version on both systems. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com