Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ikd0w-0001Se-RU for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Dec 2019 23:57:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ikd0v-0000ij-JS for pgsql-bugs@arkaria.postgresql.org; Thu, 26 Dec 2019 23:57:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ikd0v-0000iX-5l for pgsql-bugs@lists.postgresql.org; Thu, 26 Dec 2019 23:57:57 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ikd0s-0004ur-Sf for pgsql-bugs@lists.postgresql.org; Thu, 26 Dec 2019 23:57:55 +0000 Received: by mail-qt1-x829.google.com with SMTP id d5so23424980qto.0 for ; Thu, 26 Dec 2019 15:57:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1Xh6B8WXWZ0lhnCj804s3T16L7/ZuBCV2+f0DLDqTa8=; b=Q3GFqkuKfJVbFC4v3QP98aOscxZ17Xwl6RM8oXDQ9Y18AmHEKQUeUV5tH+c1yUo+8C ssrLmfjOCoasxkT9us+9G5PBHUM5sdHe/Ro4f11ph/cOdzhOj+BsOjabjWmWx+ptHChM bjNNkHj8IzyUacVsbC0z08Lb1EivAbb7E2R3I9pDOCQDXTZsqTO5uTSls0uxekYR8AMa 1yLUPdNFoXdFs8itpgGsvEz5/6fPu5c090c4sos99KpQB0m6yQiJNTZuvazI43J+MK+R o9uEf/c9bLCAQNeh/pS1ujWtWVqogIRJJt+nUZRBeBJxmh2YsDEUjJYqOviK9roAzxiC KDVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=1Xh6B8WXWZ0lhnCj804s3T16L7/ZuBCV2+f0DLDqTa8=; b=UPKlbfsXwpYBS5NtMT2fgrf8qJm59GQ2nvxSPH1BRVyCEVg1ePeB0PQCdrYGZVZZA+ RtECcQ2RjmyrQ3Im+2BZ71f7zHki+qpyVpMt5PfQGVXmJVoa9U4p8P/nmB6M4cLZDNjK h1rAK08Kq8nUNxR1+Jwf1auOc6ul+vf/XlyVolfMDbwblt39D9CTRGQa2PCSiMqALM4w NSJQM69BQcs1QeuffYqa3XGii2yiYFI9DuXFP44gyPlazZLNSFSFqIGSPbdpuwP7bZZf utjBtOuk62TxAR9EtBF3lhv0xWgKn9s6VlwCXm/AhpWSWCqe6qXYh+iy2iGSwZTvA1Lg nZZA== X-Gm-Message-State: APjAAAUmeO5jtmCXCyqUgtrH0RaubQPY4G8ebVOrDsh8H3IOzfFafmW/ iwyfqb9Bw9EZYINf9RQbAO0= X-Google-Smtp-Source: APXvYqx6pniDXdtJE5PkswHXjlY3hY08T0l6RnqQo748qAJNLrx+PTK845KZPOzCDIThGRO0657q6g== X-Received: by 2002:ac8:a83:: with SMTP id d3mr36816192qti.228.1577404673573; Thu, 26 Dec 2019 15:57:53 -0800 (PST) Received: from [192.168.2.2] (pool-173-79-120-3.washdc.fios.verizon.net. [173.79.120.3]) by smtp.gmail.com with ESMTPSA id e64sm9974533qtd.45.2019.12.26.15.57.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Dec 2019 15:57:53 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: Indexing on JSONB field not working From: Zhihong Zhang In-Reply-To: <9485.1577404294@sss.pgh.pa.us> Date: Thu, 26 Dec 2019 18:57:52 -0500 Cc: Tomas Vondra , Jeff Janes , pgsql-bugs Content-Transfer-Encoding: quoted-printable Message-Id: References: <20191220223005.f6w4ff4kdbgtanpz@development> <83E6A3F7-B1B4-4AD6-905A-BE11D244D35A@gmail.com> <4910.1577386715@sss.pgh.pa.us> <0A83C661-EDBB-43C8-9CBB-FB1E321A15CB@gmail.com> <12042.1577393358@sss.pgh.pa.us> <20191226234124.wuarzcbdq5z5msiy@development> <9485.1577404294@sss.pgh.pa.us> To: Tom Lane X-Mailer: Apple Mail (2.3608.40.2.2.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I created the index myself using the same account. Should I be the = owner? Zhihong > On Dec 26, 2019, at 6:51 PM, Tom Lane wrote: >=20 > Tomas Vondra writes: >> On Thu, Dec 26, 2019 at 05:25:22PM -0500, Zhihong Zhang wrote: >>> I am not superuser. Let me see how I can get access to the superuser = on RDS. >=20 >> You can't - that's the point of am environment managed by someone = else. >> Perhaps you could inspect the data directly in pg_statistic, not = through >> the pg_stats view. But I haven't tried if that works on RDS. >=20 > He definitely shouldn't be able to do that, if not superuser. >=20 > However, after experimenting a bit it seems like pg_stats does work = for > indexes as long as you are the owner of the index's table, which = probably > explains why it took so long for anybody to notice the problem. Maybe = the > OP is trying to look at the stats as a non-owner that's just been = GRANT'ed > table access? >=20 > regards, tom lane