From: | Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> |
---|---|
To: | jian he <jian(dot)universality(at)gmail(dot)com> |
Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Extract numeric filed in JSONB more effectively |
Date: | 2023-08-03 00:50:47 |
Message-ID: | CAKU4AWrap1zpYqunJwWTN=CdP7E8e0U4mYmwn7hvTW3ERuENVg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hi Jian:
> return PointerGetDatum(v->val.numeric);
> should be something like
> PG_RETURN_NUMERIC(v->val.numeric);
> ?
>
Thanks for this reminder, a new patch is attached. and commitfest
entry is added as well[1]. For recording purposes, I compared the
new operator with all the existing operators.
select 1 from tb where (a->'a')::numeric = 2; 30.56ms
select 1 from tb where (a->>'a')::numeric = 2; 29.43ms
select 1 from tb where (a(at)->'a') = 2; 14.80ms
[1] https://commitfest.postgresql.org/44/4476/
--
Best Regards
Andy Fan
Attachment | Content-Type | Size |
---|---|---|
v2-0001-Add-jsonb-operator-to-return-a-numeric-directly.patch | application/octet-stream | 5.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Geoghegan | 2023-08-03 01:32:40 | Re: Use of additional index columns in rows filtering |
Previous Message | Matt Smiley | 2023-08-02 23:51:29 | Re: Configurable FP_LOCK_SLOTS_PER_BACKEND |