Analysis of Conditions with no results and high offset number - PostgreSQL JSONB
0
votes
0
answers
21
views
I am asked to record down the analysis on PostgreSQL JSONB query having Conditions with high offset number and query that provide no results considering the below.
select
*
from
sub_test df,
jsonb_array_elements(json_data) jba
where
(jba->>'name')::text = 'SubYear'
and (jba->>'value')::numeric > '2050';
1. SubYear > 2200 (has no results)
Explanations about the query plan, are full scans of tables necessary with JSON?
2. SubYear > 1970 (has a lot of results) and offset 30k
Explanations about the query plan, are full scans of tables necessary with JSON?
Note that there are about 35k+ records in the table "sub_test" with 500+ keys in the JSONB column "json_data"
Could you help me to answer them ?
Asked by Lingamoorthy Bheeman Balan
(1 rep)
Oct 5, 2020, 07:20 AM
Last activity: Oct 5, 2020, 07:26 AM
Last activity: Oct 5, 2020, 07:26 AM