create or replace function random_text() returns text 
as $$select string_agg(md5(random()::text),'') from generate_Series(1,8) json33keys $$ LANGUAGE SQL;

select length(random_text());

create table json33keys(a jsonb);
INSERT INTO json33keys SELECT (
	'{"id": "' || random_text() || '",'
	'"type": "' || random_text() || '",'
	'"title": "' || random_text() || '",'
	'"original_title": "' || random_text() || '",'
	'"is_adult": "' || random_text() || '",'
	'"start_year": "' || random_text() || '",'
	'"end_year": "' || random_text() || '",'
	'"minutes": "' || random_text() || '",'
	'"genres": "' || random_text() || '",'
	'"aliases": "' || random_text() || '",'
	'"genres": "' || random_text() || '",'
	'"directors": "' || random_text() || '",'
	'"writers": "' || random_text() || '",'
	'"ratings": "' || random_text() || '",'
	'"director_name": "' || random_text() || '",'
	'"alias_title": "' || random_text() || '",'
	'"alias_region": "' || random_text() || '",'
	'"director_birth_year": "' || random_text() || '",'
	'"director_death_year": "' || random_text() || '",'
	'"rating_average": "' || random_text() || '",'
	'"rating_votes": "' || random_text() || '",'
	'"id1": "' || random_text() || '",'
	'"id2": "' || random_text() || '",'
	'"id3": "' || random_text() || '",'
	'"id4": "' || random_text() || '",'
	'"id5": "' || random_text() || '",'
	'"id6": "' || random_text() || '",'
	'"id7": "' || random_text() || '",'
	'"id8": "' || random_text() || '",'
	'"id9": "' || random_text() || '",'
	'"id10": "' || random_text() || '",'
	'"id11": "' || random_text() || '",'
	'"id12": "' || random_text() || '",'
	'"id13": "' || random_text() || '"'
	||'}' )::jsonb
FROM generate_series(1, 600001);

SELECT pg_size_pretty(pg_table_size('json33keys'));  --5369 MB
-- SELECT pg_size_pretty(336224::bigint);
select count(*) from json33keys; --  600001

/*
another session call it repeatedly:
select pg_log_backend_memory_contexts(3702) \watch i=10 c=5
*/
explain(analyze, costs off)
SELECT
	json_query(a, '$."id"' returning text),
	json_query(a, '$."type"'  returning text),
	json_query(a, '$."title"' returning text),
	json_query(a, '$."original_title"' returning text),
	json_query(a, '$."is_adult"' returning text),
	json_query(a, '$."start_year"' returning text),
	json_query(a, '$."end_year"' returning text),
	json_query(a, '$."minutes"' returning text),
	json_query(a, '$."genres"' returning text),
	json_query(a, '$."aliases"' returning text),
	json_query(a, '$."directors"' returning text),
	json_query(a, '$."writers"' returning text),
	json_query(a, '$."ratings"' returning text),
	json_query(a, '$."director_name"' returning text),
	json_query(a, '$."alias_title"' returning text),
	json_query(a, '$."alias_region"' returning text),
	json_query(a, '$."director_birth_year"' returning text),
	json_query(a, '$."director_death_year"' returning text),
	json_query(a, '$."rating_average"' returning text),
	json_query(a, '$."rating_votes"' returning text),
	json_query(a, '$."id1"' returning text),
	json_query(a, '$."id2"' returning text),
	json_query(a, '$."id3"' returning text),
	json_query(a, '$."id4"' returning text),
	json_query(a, '$."id5"' returning text),
	json_query(a, '$."id6"' returning text),
	json_query(a, '$."id7"' returning text),
	json_query(a, '$."id8"' returning text),
	json_query(a, '$."id9"' returning text),
	json_query(a, '$."id10"' returning text),
	json_query(a, '$."id11"' returning text),
	json_query(a, '$."id12"' returning text),
	json_query(a, '$."id13"' returning text)
from json33keys;
/*
2024-03-07 10:25:47.618 CST [3702] LOG:  level: 3; ExecutorState: 336224 total in 10 blocks; 56152 free (3 chunks); 280072 used
2024-03-07 10:25:47.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:25:47.618 CST [3702] LOG:  level: 4; ExprContext: 104896 total in 11 blocks; 8928 free (12 chunks); 95968 used
2024-03-07 10:25:47.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:25:57.618 CST [3702] LOG:  level: 3; ExecutorState: 336224 total in 10 blocks; 56152 free (3 chunks); 280072 used
2024-03-07 10:25:57.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:25:57.618 CST [3702] LOG:  level: 4; ExprContext: 356472 total in 30 blocks; 50032 free (14 chunks); 306440 used
2024-03-07 10:25:57.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:26:07.618 CST [3702] LOG:  level: 3; ExecutorState: 336224 total in 10 blocks; 56152 free (3 chunks); 280072 used
2024-03-07 10:26:07.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:26:07.618 CST [3702] LOG:  level: 4; ExprContext: 347456 total in 29 blocks; 53392 free (14 chunks); 294064 used
2024-03-07 10:26:07.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:26:17.618 CST [3702] LOG:  level: 3; ExecutorState: 336224 total in 10 blocks; 56152 free (3 chunks); 280072 used
2024-03-07 10:26:17.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:26:17.618 CST [3702] LOG:  level: 4; ExprContext: 419584 total in 37 blocks; 26512 free (14 chunks); 393072 used
2024-03-07 10:26:17.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:25:37.618 CST [3702] LOG:  level: 3; ExecutorState: 336224 total in 10 blocks; 56152 free (3 chunks); 280072 used
2024-03-07 10:25:37.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:25:37.618 CST [3702] LOG:  level: 4; ExprContext: 419584 total in 37 blocks; 26512 free (14 chunks); 393072 used
2024-03-07 10:25:37.618 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

*/

explain(analyze, costs off)
SELECT
	json_value(a, '$."id"' returning text),
	json_value(a, '$."type"'  returning text),
	json_value(a, '$."title"' returning text),
	json_value(a, '$."original_title"' returning text),
	json_value(a, '$."is_adult"' returning text),
	json_value(a, '$."start_year"' returning text),
	json_value(a, '$."end_year"' returning text),
	json_value(a, '$."minutes"' returning text),
	json_value(a, '$."genres"' returning text),
	json_value(a, '$."aliases"' returning text),
	json_value(a, '$."directors"' returning text),
	json_value(a, '$."writers"' returning text),
	json_value(a, '$."ratings"' returning text),
	json_value(a, '$."director_name"' returning text),
	json_value(a, '$."alias_title"' returning text),
	json_value(a, '$."alias_region"' returning text),
	json_value(a, '$."director_birth_year"' returning text),
	json_value(a, '$."director_death_year"' returning text),
	json_value(a, '$."rating_average"' returning text),
	json_value(a, '$."rating_votes"' returning text),
	json_value(a, '$."id1"' returning text),
	json_value(a, '$."id2"' returning text),
	json_value(a, '$."id3"' returning text),
	json_value(a, '$."id4"' returning text),
	json_value(a, '$."id5"' returning text),
	json_value(a, '$."id6"' returning text),
	json_value(a, '$."id7"' returning text),
	json_value(a, '$."id8"' returning text),
	json_value(a, '$."id9"' returning text),
	json_value(a, '$."id10"' returning text),
	json_value(a, '$."id11"' returning text),
	json_value(a, '$."id12"' returning text),
	json_value(a, '$."id13"' returning text)
from json33keys;
/*
2024-03-07 10:27:57.444 CST [3702] LOG:  level: 3; ExecutorState: 598368 total in 11 blocks; 41984 free (4 chunks); 556384 used
2024-03-07 10:27:57.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:27:57.444 CST [3702] LOG:  level: 4; ExprContext: 178672 total in 20 blocks; 6312 free (9 chunks); 172360 used
2024-03-07 10:27:57.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:28:07.444 CST [3702] LOG:  level: 3; ExecutorState: 598368 total in 11 blocks; 41984 free (4 chunks); 556384 used
2024-03-07 10:28:07.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:28:07.444 CST [3702] LOG:  level: 4; ExprContext: 169656 total in 19 blocks; 6888 free (9 chunks); 162768 used
2024-03-07 10:28:07.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:28:17.444 CST [3702] LOG:  level: 3; ExecutorState: 598368 total in 11 blocks; 41984 free (4 chunks); 556384 used
2024-03-07 10:28:17.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:28:17.444 CST [3702] LOG:  level: 4; ExprContext: 321280 total in 35 blocks; 14592 free (10 chunks); 306688 used
2024-03-07 10:28:17.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:28:27.444 CST [3702] LOG:  level: 3; ExecutorState: 598368 total in 11 blocks; 41984 free (4 chunks); 556384 used
2024-03-07 10:28:27.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:28:27.444 CST [3702] LOG:  level: 4; ExprContext: 62288 total in 7 blocks; 5072 free (9 chunks); 57216 used
2024-03-07 10:28:27.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:28:37.444 CST [3702] LOG:  level: 3; ExecutorState: 598368 total in 11 blocks; 41984 free (4 chunks); 556384 used
2024-03-07 10:28:37.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:28:37.444 CST [3702] LOG:  level: 4; ExprContext: 44256 total in 5 blocks; 6224 free (9 chunks); 38032 used
2024-03-07 10:28:37.444 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
*/


explain(analyze, costs off)
SELECT
	jsonb_path_query(a, '$."id"')::TEXT,
	jsonb_path_query(a, '$."type"'  )::text,
	jsonb_path_query(a, '$."title"' )::text,
	jsonb_path_query(a, '$."original_title"' )::text,
	jsonb_path_query(a, '$."is_adult"' )::text,
	jsonb_path_query(a, '$."start_year"' )::text,
	jsonb_path_query(a, '$."end_year"' )::text,
	jsonb_path_query(a, '$."minutes"' )::text,
	jsonb_path_query(a, '$."genres"' )::text,
	jsonb_path_query(a, '$."aliases"' )::text,
	jsonb_path_query(a, '$."directors"' )::text,
	jsonb_path_query(a, '$."writers"' )::text,
	jsonb_path_query(a, '$."ratings"' )::text,
	jsonb_path_query(a, '$."director_name"' )::text,
	jsonb_path_query(a, '$."alias_title"' )::text,
	jsonb_path_query(a, '$."alias_region"' )::text,
	jsonb_path_query(a, '$."director_birth_year"' )::text,
	jsonb_path_query(a, '$."director_death_year"' )::text,
	jsonb_path_query(a, '$."rating_average"' )::text,
	jsonb_path_query(a, '$."rating_votes"' )::text,
	jsonb_path_query(a, '$."id1"' )::text,
	jsonb_path_query(a, '$."id2"' )::text,
	jsonb_path_query(a, '$."id3"' )::text,
	jsonb_path_query(a, '$."id4"' )::text,
	jsonb_path_query(a, '$."id5"' )::text,
	jsonb_path_query(a, '$."id6"' )::text,
	jsonb_path_query(a, '$."id7"' )::text,
	jsonb_path_query(a, '$."id8"' )::text,
	jsonb_path_query(a, '$."id9"' )::text,
	jsonb_path_query(a, '$."id10"' )::text,
	jsonb_path_query(a, '$."id11"' )::text,
	jsonb_path_query(a, '$."id12"' )::text,
	jsonb_path_query(a, '$."id13"' )::text
from json33keys;
/*
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 3; ExecutorState: 663840 total in 11 blocks; 275872 free (37 chunks); 387968 used
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 4; tSRF function arguments: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:38.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used


2024-03-07 10:30:28.163 CST [3702] LOG:  level: 3; ExecutorState: 663840 total in 11 blocks; 274816 free (15 chunks); 389024 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1616 free (8 chunks); 9448 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; tSRF function arguments: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; ExprContext: 32768 total in 3 blocks; 7920 free (3 chunks); 24848 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:30:28.163 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:30:48.163 CST [3702] LOG:  level: 3; ExecutorState: 663840 total in 11 blocks; 274384 free (6 chunks); 389456 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1584 free (8 chunks); 9480 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:48.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used


2024-03-07 10:30:58.163 CST [3702] LOG:  level: 3; ExecutorState: 663840 total in 11 blocks; 274288 free (4 chunks); 389552 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:30:58.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used

2024-03-07 10:31:08.163 CST [3702] LOG:  level: 3; ExecutorState: 663840 total in 11 blocks; 274480 free (8 chunks); 389360 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1616 free (8 chunks); 9448 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1536 free (8 chunks); 9528 used
2024-03-07 10:31:08.163 CST [3702] LOG:  level: 4; SRF multi-call context: 11064 total in 3 blocks; 1568 free (8 chunks); 9496 used
*/

explain(analyze, costs off)
SELECT jt.* FROM json33keys t,
	json_table(t.a, '$'
		COLUMNS (
		"id" text path '$."id"',
		"type" text path '$."type"',
		"title" text path '$."title"',
		"original_title" text path '$."original_title"',
		"is_adult" text path '$."is_adult"',
		"start_year" text path '$."start_year"',
		"end_year" text path '$."end_year"',
		"minutes" text path '$."minutes"',
		"genres" text path '$."genres"',
		"aliases" text path '$."aliases"',
		"directors" text path '$."directors"',
		"writers" text path '$."writers"',
		"ratings" text path '$."ratings"',
		"director_name" text path '$."director_name"',
		"alias_title" text path '$."alias_title"',
		"alias_region" text path '$."alias_region"',
		"director_birth_year" text path '$."director_birth_year"',
		"director_death_year" text path '$."director_death_year"',
		"rating_average" text path '$."rating_average"',
		"rating_votes" text path '$."rating_votes"',
		"id1" text path '$."id1"',
		"id2" text path '$."id2"',
		"id3" text path '$."id3"',
		"id4" text path '$."id4"',
		"id5" text path '$."id5"',
		"id6" text path '$."id6"',
		"id7" text path '$."id7"',
		"id8" text path '$."id8"',
		"id9" text path '$."id9"',
		"id10" text path '$."id10"',
		"id11" text path '$."id11"',
		"id12" text path '$."id12"',
		"id13" text path '$."id13"'
		)
) as jt;
/*
2024-03-07 10:33:06.703 CST [3702] LOG:  level: 3; ExecutorState: 540736 total in 8 blocks; 220544 free (8 chunks); 320192 used
2024-03-07 10:33:06.703 CST [3702] LOG:  level: 4; TableFunc per value context: 17208 total in 2 blocks; 7232 free (9 chunks); 9976 used
2024-03-07 10:33:06.703 CST [3702] LOG:  level: 5; JsonTableExecContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:06.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:06.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:06.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used


2024-03-07 10:33:16.703 CST [3702] LOG:  level: 3; ExecutorState: 540736 total in 8 blocks; 220544 free (8 chunks); 320192 used
2024-03-07 10:33:16.703 CST [3702] LOG:  level: 4; TableFunc per value context: 17208 total in 2 blocks; 7232 free (9 chunks); 9976 used
2024-03-07 10:33:16.703 CST [3702] LOG:  level: 5; JsonTableExecContext: 17208 total in 2 blocks; 7904 free (0 chunks); 9304 used
2024-03-07 10:33:16.703 CST [3702] LOG:  level: 4; ExprContext: 16384 total in 2 blocks; 6312 free (2 chunks); 10072 used
2024-03-07 10:33:16.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:16.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used


2024-03-07 10:33:26.703 CST [3702] LOG:  level: 3; ExecutorState: 540736 total in 8 blocks; 220544 free (8 chunks); 320192 used
2024-03-07 10:33:26.703 CST [3702] LOG:  level: 4; TableFunc per value context: 17208 total in 2 blocks; 7232 free (9 chunks); 9976 used
2024-03-07 10:33:26.703 CST [3702] LOG:  level: 5; JsonTableExecContext: 17208 total in 2 blocks; 7904 free (0 chunks); 9304 used
2024-03-07 10:33:26.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 1040 free (0 chunks); 7152 used
2024-03-07 10:33:26.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:26.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:33:36.703 CST [3702] LOG:  level: 3; ExecutorState: 540736 total in 8 blocks; 220544 free (8 chunks); 320192 used
2024-03-07 10:33:36.703 CST [3702] LOG:  level: 4; TableFunc per value context: 17208 total in 2 blocks; 7232 free (9 chunks); 9976 used
2024-03-07 10:33:36.703 CST [3702] LOG:  level: 5; JsonTableExecContext: 17208 total in 2 blocks; 7904 free (0 chunks); 9304 used
2024-03-07 10:33:36.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 3344 free (0 chunks); 4848 used
2024-03-07 10:33:36.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:36.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

2024-03-07 10:33:46.703 CST [3702] LOG:  level: 3; ExecutorState: 549392 total in 9 blocks; 220544 free (8 chunks); 328848 used
2024-03-07 10:33:46.703 CST [3702] LOG:  level: 4; TableFunc per value context: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:46.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:46.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used
2024-03-07 10:33:46.703 CST [3702] LOG:  level: 4; ExprContext: 8192 total in 1 blocks; 7952 free (0 chunks); 240 used

*/