diff --git a/perf_test/parse_jsonb_with_path2.sql b/perf_test/parse_jsonb_with_path2.sql new file mode 100644 index 0000000..2ab1fde --- /dev/null +++ b/perf_test/parse_jsonb_with_path2.sql @@ -0,0 +1,37 @@ +create temp table x as ( +select + (rec #>>('{batch}'::text[]))::text as batch + ,(rec #>>('{week}'::text[]))::text as week + ,(rec #>>('{period_end}'::text[]))::text as period_end + ,(rec #>>('{pay_date}'::text[]))::text as pay_date + ,(rec #>>('{adp_comp}'::text[]))::text as adp_comp + ,(rec #>>('{hours_reg}'::text[]))::numeric as hours_reg + ,(rec #>>('{hours_ot}'::text[]))::numeric as hours_ot + ,(rec #>>('{adp_dep_home}'::text[]))::text as adp_dep_home + ,(rec #>>('{adp_dep}'::text[]))::text as adp_dep + ,(rec #>>('{gl_dep}'::text[]))::text as gl_dep + ,(rec #>>('{checkn}'::text[]))::text as checkn + ,(rec #>>('{employee}'::text[]))::text as employee + ,(rec #>>('{title}'::text[]))::text as title + ,(rec #>>('{prim_offset}'::text[]))::text as prim_offset + ,(rec #>>('{cms_tb}'::text[]))::text as cms_tb + ,(rec #>>('{cms_acct}'::text[]))::text as cms_acct + ,(rec #>>('{gl_descr}'::text[]))::text as gl_descr + ,(rec #>>('{amount}'::text[]))::numeric as amount +FROM + tps.trans +WHERE + srce = 'ADPRP' + ) with data + +-- SELECT 1603392 Query returned successfully in 13 secs 604 msec. + + +/* +build to table --> 13 sec +run an aggregate on the table --> 1.5 sec +-versus- +run a basic aggregate on the json data live --> 7 sec +-versus- +run a basic aggregate on the json data with jsonb_popualte_record --> 8 sec +*/ \ No newline at end of file diff --git a/readme.md b/readme.md index 621598f..ab679b5 100644 --- a/readme.md +++ b/readme.md @@ -93,7 +93,6 @@ source definition "constraint":[ "{doc}" ], - "schema_type":"JSONB_POPULATE", "table_schema":[ { "path":"{doc,origin_addresses,0}",