SlideShare a Scribd company logo
JSON caveats and tricks
Advanced edition
Oracle 12.1
Agenda
1. JSON in relational storage
2. RDMS Configuration
3. Storage
4. Ingestion
5. Retrieval
6. Search
7. Maintenance
8. Fast search
9. Summary
10. Q&A session
JSON in RDBMS
Why
• Consistency (integrity, transaction ACIDity) for storing JSON documents
• Denormalization of complex objects
What
• Logs with responses/requests received/sent during software interaction
• Configuration data, key/value user preferences
• Unstructured or semi-structured complex objects
and please forget about any analytics by JSON fields 
DB configuration
• Install JSON fixes on regular base
• Retain scripts to check old issues – new fixes restores them often
• These patches MUST be installed
1. Patch 20080249: JSON Patch Bundle 1
2. Patch 20885778: JSON Patch Bundle 2
3. Patch 24836374: JSON Patch Bundle 3
Oracle thinks JSON is stable now so no more dedicated JSON Bundle patches!
Fixes are inside ordinal database proactive bundle patches (Doc ID 1937782.1).
DB configuration
Table structure
UCS2
10000
Table structure
BLOB for JSON benefits:
• Twice less space consumption
• less I/O due less space
• No implicit character-set conversion if the database
character set is not AL32UTF8
RFC 4627
Table structure
JAVA processing fails
Table structure
Constraint works fine but JAVA still fails 
Table structure
Ingestion
• Oracle treats JSON as string – no tailored object type
• Insert works fine
• No option to update a piece of JSON
Ingestion
Ingestion
N, run
with json
strict
with json
lax
with json lax and unique
names without constraints
1 115 121 132 83
2 119 117 142 80
3 119 115 132 91
4 115 110 136 90
5 117 125 138 92
6 122 117 135 90
7 116 117 134 88
8 127 120 142 81
9 115 125 152 80
10 118 114 147 83
AVG 118,3 118,1 139 85,8
Ingestion
Ingestion
N, run
with json
strict with json lax
with json lax and unique
names
without
constraints with cache
1 115 121 132 83 78
2 119 117 142 80 78
3 119 115 132 91 84
4 115 110 136 90 75
5 117 125 138 92 78
6 122 117 135 90 75
7 116 117 134 88 75
8 127 120 142 81 78
9 115 125 152 80 77
10 118 114 147 83 77
AVG 118,3 118,1 139 85,8 77,5
Ingestion nuances
If you use JSON in DWH/OLTP tandem please be careful
Ingestion nuances
Ingestion nuances
Ingestion nuances
JSON is mentioned nowhere!!!
Ingestion nuances
Ingestion nuances
ALTER SYSTEM SET EVENTS 'TRACE [DIRPATH_LOAD] DISK=high';
ALTER SESSION SET EVENTS '10357 trace name context forever, level 1'; Trace out of data 
Retrieval
• Extract 1 row with raw JSON data and pass it to application server as is
• Issue SQL statement which extracts 1 row from table and parses it via Oracle
JSON feature
• Create a view which encapsulates JSON treatment and extract a row from the view
Retrieval
Nothing changes
Retrieval
Bad approach – each json_value function parses JSON again!
The same for .notation!
In Oracle 12.2 it works fine + query rewrite magic!
Retrieval
Storage logic could be encapsulated inside virtual columns
Switch Adaptive Optimization off
or
Patch 24563796: WRONG RESULT IN COLUMN VALUE IN 12C should be applied!
Retrieval
Retrieval
Retrieval
Retrieval
Retrieval
Retrieval issues
1. Often become non mergeable so performance degrades
2. ORA-600 and ORA-7445 No Data to be read from socket arise in arbitrary
places
3. Count(distinct <field>) fails with ORA-7445 No Data to be read from
socket.
Could be fixed by removing group by, adding row_number() over (partition by <group by fields>) rn and
filtering out records where rn <> 1
4. If 2 or more json_table are used exception doesn’t occur but results could be
wrong in aggregate functions.
Retrieval
Retrieval issues mitigation
1. Try to rewrite to use one json_table statement only
2. If it doesn’t help or impossible try /*+ NO_MERGE */ hint
1. If /*+ NO_MERGE */ doesn’t help use /*+
NO_QUERY_TRANSFORMATION*/
Retrieval
Retrieval
Search
Search
Search
Separate indexes should be
created for .notation?
Search
Search
Query rewrite
Search
Use index side effect – create JSON validation
ORA-01722: invalid number
Validator 
Search
Multiple columns indexing
Search
Search
Search
Search
Search
Search
Search
Search
. notation is not supported again!
Search Quiz 1
= 0
2 different tokens
= 1
Search Quiz 2
Search Quiz 2
Who stolen titles?!
Never do it with JSON!!!
Search Quiz 2
Bla-bla-bla about 200 lines
Search Quiz 2
Search Quiz 3
Task: find json with value = ‘640’ in class type ‘Country’.
Search
Search
5 steps
Search
filter
Anchor Inside one
object
3 steps
Ingestion
= 0
= 1
Ingestion
= 0
= 1
Ingestion
Execution time: ~125 seconds
Ingestion
Ingestion
Execution time: ~7 seconds
Refresh job execution time: ~4 seconds
Ingestion
Ingestion
Execution time: ~8 seconds
Ingestion
= 0
= 0
= 0
= 0
= 1
TRANSACTIONAL doesn’t work for sections! Only for tokens!
Query performance 2x slower!
Ingestion
Ingestion
Execution time: ~6 seconds
Extra fast search
Put FTS index IN-MEMORY
1. Allocate memory area KEEP pool
2. Pin in KEEP pool:
− DR$ tables
− DR$ indexes
− LOB segments of DR$ tables
3. Load once by stored procedure or do nothing – IN-MEMORY will be populated by itself
Until server reboot 
Execution and search time: ~1 second!
P.S. alter index <index name> rebuild kills all KEEP POOL settings. Use CTX_DDL.SYNC only!
Maintenance
Posfix/prefix columns with JSON data via _JSON like INVOICE_JSON before.
• Create daily checks
1. If you need control JSON format (strict/lax) use dba_tab_columns and
all_json_columns views to check JSON constrains
2. If you need insert performance check dba_lobs to check cache attribute
• Check CONTEXT indexes are in proper state especially after truncate or huge
delete operation. If bad – rebuild with KEEP pool fix.
Maintenance
Provide regular indexes optimization
1. Collect fragmented indexes (estimated row fragmentation). Up to 10x
performance degradation in case of fragmentation
2. Collect indexes with many deleted rows (estimated garbage size)
3. Run ctx_ddl.optimize_index in FULL mode (SERIAL or PARALLEL)
Conclusion
• JSON is always tradeoff between performance/data treatment convenience/integrity
• Indexing strategy should be checked very careful you use 2 notations especially
• JSON treatment is mostly acceptable in row-per-row scenario
• JSON features are still non-stable
• Oracle fails with JSON more 2 Mb very often
• Current implementation doesn’t look like “document-stored” DB
• Tailored search solutions bring better performance
and we are waiting Oracle 12.2 
Q&A

More Related Content

What's hot

Oracle High Availabiltity for application developers
Oracle High Availabiltity for application developersOracle High Availabiltity for application developers
Oracle High Availabiltity for application developers
Alexander Tokarev
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
Alex Zaballa
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Alex Zaballa
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersJonathan Levin
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Dave Stokes
 
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dave Stokes
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
Dave Stokes
 
Capturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLCapturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLPadraig O'Sullivan
 
PostgreSQL Advanced Queries
PostgreSQL Advanced QueriesPostgreSQL Advanced Queries
PostgreSQL Advanced Queries
Nur Hidayat
 
MySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentationMySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentation
Dave Stokes
 
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & HistogramsConfoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
Dave Stokes
 
Oracle 12.2 sharding learning more
Oracle 12.2 sharding learning moreOracle 12.2 sharding learning more
Oracle 12.2 sharding learning more
Leyi (Kamus) Zhang
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
Dave Stokes
 
cPanel now supports MySQL 8.0 - My Top Seven Features
cPanel now supports MySQL 8.0 - My Top Seven FeaturescPanel now supports MySQL 8.0 - My Top Seven Features
cPanel now supports MySQL 8.0 - My Top Seven Features
Dave Stokes
 
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Alex Zaballa
 
Administering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud ClustersAdministering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud Clusters
lucenerevolution
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
Dave Stokes
 

What's hot (20)

Oracle High Availabiltity for application developers
Oracle High Availabiltity for application developersOracle High Availabiltity for application developers
Oracle High Availabiltity for application developers
 
Oracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New FeaturesOracle Database 12.1.0.2 New Features
Oracle Database 12.1.0.2 New Features
 
Sql killedserver
Sql killedserverSql killedserver
Sql killedserver
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Scaling MySQL Strategies for Developers
Scaling MySQL Strategies for DevelopersScaling MySQL Strategies for Developers
Scaling MySQL Strategies for Developers
 
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should KnowDBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
DBA Brasil 1.0 - DBA Commands and Concepts That Every Developer Should Know
 
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
Longhorn PHP - MySQL Indexes, Histograms, Locking Options, and Other Ways to ...
 
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and HistogramsDutch PHP Conference 2021 - MySQL Indexes and Histograms
Dutch PHP Conference 2021 - MySQL Indexes and Histograms
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
 
Capturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQLCapturing, Analyzing, and Optimizing your SQL
Capturing, Analyzing, and Optimizing your SQL
 
PostgreSQL Advanced Queries
PostgreSQL Advanced QueriesPostgreSQL Advanced Queries
PostgreSQL Advanced Queries
 
MySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentationMySQL Replication Update - DEbconf 2020 presentation
MySQL Replication Update - DEbconf 2020 presentation
 
Confoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & HistogramsConfoo 2021 - MySQL Indexes & Histograms
Confoo 2021 - MySQL Indexes & Histograms
 
Oracle 12.2 sharding learning more
Oracle 12.2 sharding learning moreOracle 12.2 sharding learning more
Oracle 12.2 sharding learning more
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
 
cPanel now supports MySQL 8.0 - My Top Seven Features
cPanel now supports MySQL 8.0 - My Top Seven FeaturescPanel now supports MySQL 8.0 - My Top Seven Features
cPanel now supports MySQL 8.0 - My Top Seven Features
 
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
Flex Cluster e Flex ASM - GUOB Tech Day - OTN TOUR LA Brazil 2014
 
Administering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud ClustersAdministering and Monitoring SolrCloud Clusters
Administering and Monitoring SolrCloud Clusters
 
MySQL 8.0 Operational Changes
MySQL 8.0 Operational ChangesMySQL 8.0 Operational Changes
MySQL 8.0 Operational Changes
 

Similar to Oracle JSON internals advanced edition

Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
Nirav Shah
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
Dbms &amp; oracle
Dbms &amp; oracleDbms &amp; oracle
Dbms &amp; oracle
J VijayaRaghavan
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
Ajeet Singh
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
MSDEVMTL
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
Satoshi Nagayasu
 
12c Database new features
12c Database new features12c Database new features
12c Database new features
Sandeep Redkar
 
Goldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL QueriesGoldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL Queries
Dave Stokes
 
Oracle notes
Oracle notesOracle notes
Oracle notes
Prashant Dadmode
 
从 Oracle 合并到 my sql npr 实例分析
从 Oracle 合并到 my sql   npr 实例分析从 Oracle 合并到 my sql   npr 实例分析
从 Oracle 合并到 my sql npr 实例分析
YUCHENG HU
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and Elasticsearch
Dean Hamstead
 
The Challenges of Distributing Postgres: A Citus Story
The Challenges of Distributing Postgres: A Citus StoryThe Challenges of Distributing Postgres: A Citus Story
The Challenges of Distributing Postgres: A Citus Story
Hanna Kelman
 
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
Citus Data
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
Manish Mudhliyar
 
Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespaceMarco Tusa
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008paulguerin
 
In memory databases presentation
In memory databases presentationIn memory databases presentation
In memory databases presentation
Michael Keane
 
Database.pptx
Database.pptxDatabase.pptx
Database.pptx
RiteshSharma925557
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Toronto-Oracle-Users-Group
 

Similar to Oracle JSON internals advanced edition (20)

Top 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tipsTop 10 Oracle SQL tuning tips
Top 10 Oracle SQL tuning tips
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
 
Dbms &amp; oracle
Dbms &amp; oracleDbms &amp; oracle
Dbms &amp; oracle
 
Ms sql server architecture
Ms sql server architectureMs sql server architecture
Ms sql server architecture
 
SQL Server 2016 novelties
SQL Server 2016 noveltiesSQL Server 2016 novelties
SQL Server 2016 novelties
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
 
12c Database new features
12c Database new features12c Database new features
12c Database new features
 
Goldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL QueriesGoldilocks and the Three MySQL Queries
Goldilocks and the Three MySQL Queries
 
Oracle notes
Oracle notesOracle notes
Oracle notes
 
从 Oracle 合并到 my sql npr 实例分析
从 Oracle 合并到 my sql   npr 实例分析从 Oracle 合并到 my sql   npr 实例分析
从 Oracle 合并到 my sql npr 实例分析
 
Perl and Elasticsearch
Perl and ElasticsearchPerl and Elasticsearch
Perl and Elasticsearch
 
The Challenges of Distributing Postgres: A Citus Story
The Challenges of Distributing Postgres: A Citus StoryThe Challenges of Distributing Postgres: A Citus Story
The Challenges of Distributing Postgres: A Citus Story
 
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
The Challenges of Distributing Postgres: A Citus Story | DataEngConf NYC 2017...
 
Oracle ORA Errors
Oracle ORA ErrorsOracle ORA Errors
Oracle ORA Errors
 
Discard inport exchange table & tablespace
Discard inport exchange table & tablespaceDiscard inport exchange table & tablespace
Discard inport exchange table & tablespace
 
Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008Myth busters - performance tuning 102 2008
Myth busters - performance tuning 102 2008
 
In memory databases presentation
In memory databases presentationIn memory databases presentation
In memory databases presentation
 
Database.pptx
Database.pptxDatabase.pptx
Database.pptx
 
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?Extreme Availability using Oracle 12c Features: Your very last system shutdown?
Extreme Availability using Oracle 12c Features: Your very last system shutdown?
 

More from Alexander Tokarev

Rate limits and all about
Rate limits and all aboutRate limits and all about
Rate limits and all about
Alexander Tokarev
 
rnd teams.pptx
rnd teams.pptxrnd teams.pptx
rnd teams.pptx
Alexander Tokarev
 
FinOps for private cloud
FinOps for private cloudFinOps for private cloud
FinOps for private cloud
Alexander Tokarev
 
Graph ql and enterprise
Graph ql and enterpriseGraph ql and enterprise
Graph ql and enterprise
Alexander Tokarev
 
FinOps introduction
FinOps introductionFinOps introduction
FinOps introduction
Alexander Tokarev
 
Open Policy Agent for governance as a code
Open Policy Agent for governance as a code Open Policy Agent for governance as a code
Open Policy Agent for governance as a code
Alexander Tokarev
 
Relational databases for BigData
Relational databases for BigDataRelational databases for BigData
Relational databases for BigData
Alexander Tokarev
 
Cloud DWH deep dive
Cloud DWH deep diveCloud DWH deep dive
Cloud DWH deep dive
Alexander Tokarev
 
Cloud dwh
Cloud dwhCloud dwh
Inmemory BI based on opensource stack
Inmemory BI based on opensource stackInmemory BI based on opensource stack
Inmemory BI based on opensource stack
Alexander Tokarev
 
Oracle InMemory hardcore edition
Oracle InMemory hardcore editionOracle InMemory hardcore edition
Oracle InMemory hardcore edition
Alexander Tokarev
 
Tagging search solution design Advanced edition
Tagging search solution design Advanced editionTagging search solution design Advanced edition
Tagging search solution design Advanced edition
Alexander Tokarev
 
Faceted search with Oracle InMemory option
Faceted search with Oracle InMemory optionFaceted search with Oracle InMemory option
Faceted search with Oracle InMemory option
Alexander Tokarev
 
Tagging search solution design
Tagging search solution designTagging search solution design
Tagging search solution design
Alexander Tokarev
 
Data structures for cloud tag storage
Data structures for cloud tag storageData structures for cloud tag storage
Data structures for cloud tag storage
Alexander Tokarev
 

More from Alexander Tokarev (15)

Rate limits and all about
Rate limits and all aboutRate limits and all about
Rate limits and all about
 
rnd teams.pptx
rnd teams.pptxrnd teams.pptx
rnd teams.pptx
 
FinOps for private cloud
FinOps for private cloudFinOps for private cloud
FinOps for private cloud
 
Graph ql and enterprise
Graph ql and enterpriseGraph ql and enterprise
Graph ql and enterprise
 
FinOps introduction
FinOps introductionFinOps introduction
FinOps introduction
 
Open Policy Agent for governance as a code
Open Policy Agent for governance as a code Open Policy Agent for governance as a code
Open Policy Agent for governance as a code
 
Relational databases for BigData
Relational databases for BigDataRelational databases for BigData
Relational databases for BigData
 
Cloud DWH deep dive
Cloud DWH deep diveCloud DWH deep dive
Cloud DWH deep dive
 
Cloud dwh
Cloud dwhCloud dwh
Cloud dwh
 
Inmemory BI based on opensource stack
Inmemory BI based on opensource stackInmemory BI based on opensource stack
Inmemory BI based on opensource stack
 
Oracle InMemory hardcore edition
Oracle InMemory hardcore editionOracle InMemory hardcore edition
Oracle InMemory hardcore edition
 
Tagging search solution design Advanced edition
Tagging search solution design Advanced editionTagging search solution design Advanced edition
Tagging search solution design Advanced edition
 
Faceted search with Oracle InMemory option
Faceted search with Oracle InMemory optionFaceted search with Oracle InMemory option
Faceted search with Oracle InMemory option
 
Tagging search solution design
Tagging search solution designTagging search solution design
Tagging search solution design
 
Data structures for cloud tag storage
Data structures for cloud tag storageData structures for cloud tag storage
Data structures for cloud tag storage
 

Recently uploaded

E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
Aftab Hussain
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 

Recently uploaded (20)

E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
Graspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code AnalysisGraspan: A Big Data System for Big Code Analysis
Graspan: A Big Data System for Big Code Analysis
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 

Oracle JSON internals advanced edition

Editor's Notes

  1. Добрый день. Это версия презентации, которую я читал на PgDay для ценителей. В ней как всегда ещё больше забавных тонкостей, без которых не обходится не один production. One of our projects uses JSON extensively so we have a lot of stuff to share with you . We found quite a few JSON caveats you whether may or not face with in Oracle 12.1. We will cover the best part of issues you could face with starting from a decision to use JSON in Oracle to daily maintenance and will try to advice how to process JSON efficiently. Please pay attention some advices will be useless in Oracle 12.2 especially related to search.
  2. We will try to go through full JSON field lifecycle. Please pay attention some of principles being mentioned will not be connected to JSON but without them good DB performance will be impossible. I divided retrieval and search which look similar but the difference will be clear further. Sometimes we will return to plan point because of additional workarounds.
  3. Let’s discuss what for do we need JSON in RDBMS These objects is something like tags, questionnaires, documents with many levels of nesting which requires huge number of relational tables. Key idea – avoid extra joins.
  4. Please don’t forget about Support – check latest JSON fixes. Without installed patches there a tons of errors: ora-600, no read data from the socket, 2 json_tables don’t work in different session, FORMAT JSON should be mentioned in case of BLOB fields.
  5. I recommend that patch – JSON works better definetly.
  6. Let’s decide how we would like to store our JSON. Which table is better? DB encoding is Oracle-recommended AL32UTF8 Let’s add 10000 records in each table and check space consumption. Universal Coded Character Set - ucs
  7. So final structure recommended by Oracle is
  8. We created a table with BLOB, put but JAVA side failed with number conversion. Let’s add is json constraint to ensure no wrong data in our table.
  9. We created a table with BLOB, put but JAVA side failed with number conversion. Let’s add is json constraint to ensure no wrong data in our table.
  10. Let’s check in any online JSON validator Why Oracle passes invalid JSON? Is it actually invalid? 50/50 Oracle default is Lax. If you need to be completely sure for any JSON parser use STRICT.
  11. If we use . Notation it fails so have to rewrite all json which leads to huge I/O in case of JSON + sophisticated PL/SQL processing in case of JSON more 4000 bytes. If we need update JSON we create small Java utilities which run in our CI tool. It works faster that sql/plsql in Java bulk processing especially.
  12. We created perfect looking json table structure and started to ingest our data. Let’s measure just time, without context switches and e.t.c. otherwise we have no time to check all stuff during the presentation. We will use rather simple script. It is slow and let’s omit BULK. Even if we add it the performance is low. At least I state it is low. What the reason? How to defeat it? Let’s remove our constraints we just created to see which one contributes more
  13. We have decent speed but it is still an issue. Is it possible to get more? Any ideas? Without bulk, pure sql and obvious stuff?
  14. Let me give you a glue What Oracle documentation says about it?
  15. So ingestion is twice faster with CACHE and without constraints Frankly speaking we don’t switch off constraint but having known our data we use CACHE for best part of our BLOB intended for JSON. I hope you all have tests of your database structure so add something like it there and discuss with your developers why they didn’t set cache for the particular BLOB
  16. Итак, создадим таблицу из которой будем загружать данные.
  17. Смотрим план выполнения запроса. Все ожидаемо.
  18. Итак, внесём интриги. Добавим констрейнт в таблицу-приёмник. Казалось бы, всё хорошо. Проблемы нет, но...
  19. Итак, создадим таблицу из которой будем загружать данные.
  20. Продолжим наш эксперимент Удалим констрейнт на приемнике и добавим в наш запрос условие, никак не связаное с джейсоном
  21. А теперь удаляем констрейнт на источнике И о чудо.direct path возвращается
  22. Retrieval – extract information from JSON There are many options. The first way is common way before Oracle 12 and it works fine. Let’s consider others 2.
  23. The simplest option – use . Notation. Let’s check. Doesn’t work. Let’s add an alias. Doesn’t work as well. Let’s add a check and it works now
  24. Let’s try to work with json_value and complex structures .notation doesn’t work with arrays in Oracle 12.1 but does work in Oracle 12.2 p.s. oracle 12.2 rewrites many json_value to a single json_table call
  25. NOTES about new patch
  26. JSON table looks very promising. Single parsing, a little verbose syntax, arrays work perfect so sounds cool! Isn’t it?
  27. Let’s have a look into other example which seems very straighforward We have 2 json_table which takes a lot of effort from CPU We got the result but what’s the price – 2 parse and unreadable sql!
  28. Let’s have a look into other example which seems very straighforward We have 2 json_table which takes a lot of effort from CPU We got the result but what’s the price – 2 parse and unreadable sql!
  29. Let’s make it simpler – json_table works for the same line so could be used in a such manner We have 2 json_table which takes a lot of effort from CPU + risks of issues due many json_table
  30. So it is the proper way and 1 sql call
  31. It is rather hard to show issues with view without showing production data but we collected all issues
  32. Мы используем следующую последовательность действий, когда json начинается странно себя вести в сложных запросах
  33. For sure if there is no index we have full scans which is bad actually. Let’s create the index. Plan is the same. The reason is filter condition
  34. So we have to create indexes completely equal to filter conditions and we have them in the plan
  35. Let’s check .notation – we should ensure the index is used so we see that it is done internally via JSON_QUERY rather than JSON value so we need to create separate set of indexes.
  36. Let’s do it Let’s run and see what we get. What do you think? Exception!!! Once we add the alias the index works fine I hope you knows how these indexes work inside – they are virtual columns where extended statistic is gather but it is another story
  37. Nevertheless it is possible to have only 1 index. Once we have it we could use . notation but we make json field more rigid.
  38. Creating indexes we could maintain sort of json schema
  39. There are 2 options for multiple column indexing. The straightforward and not. Queries are a little bit ugly
  40. Let’s try more appropriate way. As we seen for indexes they work using virtual columns. Let’s use the same approach. Once we add columns index them as the ordinal ones.
  41. Let’s try more appropriate way. As we seen for indexes they work using virtual columns. Let’s use the same approach. Once we add columns index them as the ordinal ones.
  42. Let’s start the latest case. Which index will be used? What should we do? Let’s move to the next slide.
  43. Let’s create an index without dropping others indexes and check all our queries.
  44. Even json table as well as others statements and multi-column queries work properly.
  45. Even json table as well as others statements and multi-column queries work properly.
  46. It sounds very good to be in our slides but for sure there are caveats.
  47. How many rows do you expect to see? Let’s have a look into the plan. The plan has CONTAIN which is Oracle Text operator and _ is a placeholder. Moreover _ is a letter delimiter in default lexert that’s why the second query returns 2 row. There is 2 tokens in reverted index. So we should instruct Oracle text to search by whole phrase. The behavior changes from patch to patch. So Oracle full text indexes are rather tricky. There are quite a few of nuances like bitmap index conversion, filter by indexes but it is out of current scope.
  48. How many rows do you expect to see? Let’s have a look into the plan. The plan has CONTAIN which is Oracle Text operator and _ is a placeholder. Moreover _ is a letter delimiter in default lexert that’s why the second query returns 2 row. There is 2 tokens in reverted index. So we should instruct Oracle text to search by whole phrase. The behavior changes from patch to patch. So Oracle full text indexes are rather tricky. There are quite a few of nuances like bitmap index conversion, filter by indexes but it is out of current scope.
  49. How many rows do you expect to see? Let’s have a look into the plan. The plan has CONTAIN which is Oracle Text operator and _ is a placeholder. Moreover _ is a letter delimiter in default lexert that’s why the second query returns 2 row. There is 2 tokens in reverted index. So we should instruct Oracle text to search by whole phrase. The behavior changes from patch to patch. So Oracle full text indexes are rather tricky. There are quite a few of nuances like bitmap index conversion, filter by indexes but it is out of current scope.
  50. How many rows do you expect to see? Let’s have a look into the plan. The plan has CONTAIN which is Oracle Text operator and _ is a placeholder. Moreover _ is a letter delimiter in default lexert that’s why the second query returns 2 row. There is 2 tokens in reverted index. So we should instruct Oracle text to search by whole phrase. The behavior changes from patch to patch. So Oracle full text indexes are rather tricky. There are quite a few of nuances like bitmap index conversion, filter by indexes but it is out of current scope.
  51. How many rows do you expect to see? Let’s have a look into the plan. The plan has CONTAIN which is Oracle Text operator and _ is a placeholder. Moreover _ is a letter delimiter in default lexert that’s why the second query returns 2 row. There is 2 tokens in reverted index. So we should instruct Oracle text to search by whole phrase. The behavior changes from patch to patch. So Oracle full text indexes are rather tricky. There are quite a few of nuances like bitmap index conversion, filter by indexes but it is out of current scope.
  52. Let’s play with indexes and json where there is a lot of nested elements. We need to Please pay attention we have 2 of them.
  53. Let’s try to find data by equal queries. All of them return 2 records which looks like or. Oracle textcontains deals with tokens as we know so if it finds a token in a document it is happy. There is no way to fix a a JSON object boundaries.
  54. Let’s try to use JSON table. It works. But could we make the search faster?
  55. And we have a good plan which limits by tokens and next filter by expression. Moreover we don’t waste time for JSON_TABLE so it is faster from I/O and CPU prospectives
  56. Let’s check how data ingestion works with FTS indexes Let’s add a new record. How many record will we see? Zero! Why? JSON indexes are fts so need be refreshed separately. Once we did it we see a record.
  57. How to address the issue? Let’s have a look into the dictionary. Let’s fix it. We need to issue replace_metadata mentioning REPLACE METADATA once again. Let’s repeat the query and will see new sync type. I deleted the record with ID 8888888 and repeated insert from previous page. How many records do we get? So the conclusion is if you need to use context indexes after you inserted data you need something else but we discuss it further.
  58. Let’s check the performance and run our well know script with intermediary commit. Execution time is huge comparing first execution (about 2 seconds) with json strict and unique identifiers. So the question: which command takes the best part of time if we have a look into database logs? No, it will be other which is invoked before each commit implicitly.
  59. Let’s defer index update without inventing a wheel like hand-made job procedures. If we have a look in details it is done by job but the profit is when you drop the index it will be dropped automatically + refresh metadata are in the index itself. One place. So we run the script, it works slowly but definitely better even in conjunction with refresh time. Если у Вас нет грантов на create job, то создание индекса упадёт. Индекс создастся, но полнотекстовые объекты частично остаются. Приготовьте скрипты для очистки CTXSYS схемы.
  60. So we run the script, it works slowly but definitely better even in conjunction with refresh time.
  61. But what to do if we need an access indexed data transactionaly? Oracle does provide something for it. Let’s test. In order to do it drop the index and don’t forget FORCE option otherwise Oracle fails and could live orphan CTXSYS dictionary records. So let’s check how TRANSACTIONAL works. It takes information from Oracle Text staging tables before they come in the reverted index actually but it slow the queries down for sure. Usualy they work 2 times slower when decent volume of data is out of sync. It is instruction how to process CONTAINTS rather than SYNC. We still need it. Please pay attention – there is no COMMIT inside.
  62. Please pay attention – there is no COMMIT inside.
  63. So let’s check how TRANSACTIONAL works. It takes information from Oracle Text staging tables before they come in the reverted index actually but it slow the queries down for sure. Usualy they work 2 times slower when decent volume of data is out of sync. It is instruction how to process CONTAINTS rather than SYNC. We still need it. Let’s ensure we get our records via full text search commands without committing them. Let’s commit records. Nothing helps. But Oracle can’t lie. The conclusion – if you need transactional data access for json data you should invent something by yourself.
  64. Transactional option doesn’t work but we would like to have faster insert. Oracle 12 has new feature which works in terms of internals like TRANSACTIONAL i.e. deals with staging tables but with the new ones. In terms of update of the reverted index it works in async mode. It is name STAGE_ITAB. Let’s have a look in details. The first command instructs Oracle a new temporary table should be created with $G prefix equal to inverted index. The next assigns the storage to the new index and creates a job which moves data to the index. What is interesting the job is without a schedule – is invoked taking into account the DB workload. 3rd states data from staging should be moved to reverted index in async mode. Let’s have a look into the dictionary
  65. Let’s check how it works using our famous statement. It sounds good regarding we could query after commit without additional sync. For sure we still out of transaction context but still…
  66. There is yet another mean how to make the search extra fast but we’re running out of time. Let’s move to the last but not least part of our presentation. SP should load lobs, count(*) and tables thereshold otherwise buffer cache is neglected
  67. Context indexes become fragmented. Why? Unfortunately we have no time discussing it but we should have them less fragmented to provide fast search. Serial optimization makes indexes less fragmented but parallel is faster
  68. For sure it is our experience but inside DataArt we will use these guidelines further You already seen that proper json reinforced by constraints works slow but without constraints .notation doesn’t work for instance. The safest JSON treatment – extract one row, use json features as json_table, json_exist and etc Oracle json isn’t’ still stable even all patches are installed. ---- We try to use Solr or Elastic even if we have delays. Search speed SLA is more strict that SLA to see fresh data