--> show rowcount of the test table: db=# select count(*) from myjsonfile100k ; count -------- 790000 (1 row) --> show size of the test table, and index: db=# \dti+ myjsonfile100k* List of relations Schema | Name | Type | Owner | Table | Persistence | Size | Description --------+-----------------------------------+-------+----------+----------------+-------------+--------+----------------------- public | myjsonfile100k | table | aardvark | | permanent | 589 MB | public | myjsonfile100k_js_pathops_gin_idx | index | aardvark | myjsonfile100k | permanent | 135 MB | public | myjsonfile100k_pkey | index | aardvark | myjsonfile100k | permanent | 17 MB | (3 rows) --> show table+index structure db=# \d+ myjsonfile100k Table "public.myjsonfile100k" Column | Type | Collation | Nullable | Default | Storage | Stats target | Description --------+---------+-----------+----------+--------------------------------------------+----------+--------------+------------- js | jsonb | | | | extended | | id | integer | | not null | nextval('myjsonfile100k_id_seq'::regclass) | plain | | Indexes: "myjsonfile100k_pkey" PRIMARY KEY, btree (id) "myjsonfile100k_js_pathops_gin_idx" gin (js jsonb_path_ops) Access method: heap --> show single jsonb 'record' structure: db=# select jsonb_pretty(js) from myjsonfile100k limit 1; jsonb_pretty ------------------------------------------------------------------------------------------------------- { + "bool": false, + "city": "Cebu City", + "date": "1980-08-12", + "enum": "generator", + "array": [ + "Eve", + "Chandra", + "Binny", + "Tabbatha", + "Anallese" + ], + "regEx": "helloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo to you",+ "random": 11, + "country": "Iran, Islamic Republic Of", + "lastname": "Seligman", + "firstname": "Correy", + "countryCode": "DE", + "random float": 60.823, + "array of objects": [ + { + "index": 0, + "index start at 5": 5 + }, + { + "index": 1, + "index start at 5": 6 + }, + { + "index": 2, + "index start at 5": 7 + } + ], + "email from expression": "Correy.Seligman@yopmail.com", + "email uses current data": "Correy.Seligman@gmail.com" + } (1 row) --> crunch time: --> (NOTE that below I truncated the result rows with '...' for PM-display): db=# select id , js->>'firstname' as fname , js->>'lastname' as lname , * from myjsonfile100k where js @> '{"firstname": "Lilith"}' -- nevermind the crazy names, and js @> '{"lastname": "Trace"}' -- randomly generated stuff ; id | fname | lname | --------+--------+-------+------------------------------------------------------------------ 127245 | Lilith | Trace | {"bool": false, "city": "Kolkata", "date": "1995-05-14", "enum": ... 393835 | Lilith | Trace | {"bool": true, "city": "Sarajevo", "date": "1987-06-07", "enum": ... (2 rows) Time: 0.846 ms --> less than a millisecond