From: Zhihong Zhang <zhihong@gmail.com>
To: Jeff Janes <jeff.janes@gmail.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-bugs <pgsql-bugs@lists.postgresql.org>
Subject: Re: Indexing on JSONB field not working
Date: Fri, 27 Dec 2019 14:43:29 -0500
Message-ID: <31E640F0-7115-4157-AED9-8F2D8C622D2B@gmail.com> (raw)
In-Reply-To: <CAMkU=1z4do7EF5K4Kz2rjy8R_ELnGEket-TWwa=YwjMwMb_RuA@mail.gmail.com>
References: <0cf001d5b77f$bfe47e10$3fad7a30$@gmail.com>
<20191220223005.f6w4ff4kdbgtanpz@development>
<E3D6070E-72E0-4FE5-9E30-D114530F383F@gmail.com>
<CAMkU=1z8X1s0WChsgKU7SN8ngrLKHt38UhAqKn-nGTf+xbQ9zg@mail.gmail.com>
<E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com>
<CAMkU=1w8UyLY1e4N6m5nB9CmG1wjizqFS--Lmi3GZ4j1+JUP3Q@mail.gmail.com>
<83E6A3F7-B1B4-4AD6-905A-BE11D244D35A@gmail.com>
<CAMkU=1z4do7EF5K4Kz2rjy8R_ELnGEket-TWwa=YwjMwMb_RuA@mail.gmail.com>
> On Dec 27, 2019, at 12:45 PM, Jeff Janes <jeff.janes@gmail.com> wrote:
>
> Can you do `pg_dump -s -t assets ...` to get a full description of the table? If you don't want to share the full description, make sure whatever simplifications you do to it don't prevent the problem from reproducing.
>
I created a new table ‘assets_copy’ with only 3 columns. I can still reproduce the problem. The pg_dump output is attached.
Thanks!
Zhihong
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.4
-- Dumped by pg_dump version 11.6
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: assets_copy; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.assets_copy (
id character(20),
_doc jsonb,
floatvalue double precision
);
ALTER TABLE public.assets_copy OWNER TO postgres;
--
-- Name: column_float_value_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX column_float_value_idx ON public.assets_copy USING btree (floatvalue);
--
-- Name: jsonb_float_value_idx; Type: INDEX; Schema: public; Owner: postgres
--
CREATE INDEX jsonb_float_value_idx ON public.assets_copy USING btree ((((_doc #> '{floatValue}'::text[]))::double precision));
--
-- PostgreSQL database dump complete
--
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: zhihong@gmail.com, jeff.janes@gmail.com, tomas.vondra@2ndquadrant.com
Subject: Re: Indexing on JSONB field not working
In-Reply-To: <31E640F0-7115-4157-AED9-8F2D8C622D2B@gmail.com>
References: <0cf001d5b77f$bfe47e10$3fad7a30$@gmail.com> <20191220223005.f6w4ff4kdbgtanpz@development> <E3D6070E-72E0-4FE5-9E30-D114530F383F@gmail.com> <CAMkU=1z8X1s0WChsgKU7SN8ngrLKHt38UhAqKn-nGTf+xbQ9zg@mail.gmail.com> <E0F0CF2B-46DB-425C-9338-0FA59561B6B6@gmail.com> <CAMkU=1w8UyLY1e4N6m5nB9CmG1wjizqFS--Lmi3GZ4j1+JUP3Q@mail.gmail.com> <83E6A3F7-B1B4-4AD6-905A-BE11D244D35A@gmail.com> <CAMkU=1z4do7EF5K4Kz2rjy8R_ELnGEket-TWwa=YwjMwMb_RuA@mail.gmail.com> <31E640F0-7115-4157-AED9-8F2D8C622D2B@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox