SlideShare uma empresa Scribd logo
1 de 27
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
N1QL QUERY
OPTIMIZER AND
IMPROVMENTS IN 5.0
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
AGENDA
01/
02
03
Optimizer Overview
Improvements in 5.0
Q&A
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
1 OPTIMIZER
OVERVIEW
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 4
Query Execution Flow
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 5
Query Service
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 6
Query Execution Phases
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 7
Optimizer
‱ Query Rewrite
‱ N1QL does very limited rewrite.
‱ Access Path Selection
‱ KeyScan Access
‱ IndexScan Access
‱ PrimaryScan Access
‱ JOIN ORDER, Types and Methods
‱ The keyspaces specified in the FROM clause are joined in the exact order given in the query.
‱ Nested Loop Join
‱ LOOK UP JOIN
‱ Index JOIN
‱ Execution Plan
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 8
Optimizer
‱ Optimizer considers all possible ways to execute query and decides best query plan.
‱ Query plan generated based on rule based optimization
‱ If index can’t satisfy the query that index will not be chosen.
‱ If an index scan can be performed, will not perform a full / primary scan.
‱ Each query block (i.e. SELECT
 ) has its own query plan
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 9
Index Selection
‱ Online indexes
‱ Only online indexes are considered
‱ Preferred indexes
‱ USE INDEX hint is provided the indexes in that list are considered
‱ Satisfying Index condition
‱ Partial / filtered indexes that index condition is super set of query predicate are considered
‱ Satisfying Index keys
‱ Indexes whose leading keys satisfy query predicate are considered
‱ Longest satisfying index keys
‱ Redundancy is eliminated by keeping longest satisfying index keys in same order.
‱ Index with satisfying keys (a,b,c) is retained over index with satisfying (a,b)
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 10
Access Path Selection
‱ Key Scan
‱ If the query contains a USE KEYS clause, no index scan or primary scan is performed. The input document keys are taken directly
from the USE KEYS clause.
‱ Index Count Scan
‱ Covering Secondary Scan
‱ Regular secondary scan -- longest satisfying keys, intersect scan;
‱ To avoid IntersectScan, provide a hint with USE INDEX.
‱ UNNEST scan;
‱ Only array indexes with an index key matching the predicates are used for UNNEST scan.
‱ Regular primary scan
‱ If a primary scan is selected, and there is no primary index available, the query errors out.
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 11
Scan Methods
‱ Covering Primary Scan
‱ A covering primary scan is a primary scan that does not perform a subsequent document fetch. It is used for queries
that need a full / primary scan and only reference META().id.
SELECT META(t).id FROM `travel-sample` t;
‱ Regular Primary Scan
‱ A regular primary scan also performs a subsequent document fetch. It is used for queries that need a full / primary
scan and reference some document data other than META().id.
SELECT META(t).cas FROM `travel-sample` t;
SELECT * FROM `travel-sample` t;
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 12
©2016 Couchbase Inc.
Scan Methods
Covering Secondary Scan
‱ Each satisfied index with most number of index keys is examined for query coverage
‱ Shortest covering index will be used.
CREATE INDEX ts_name ON `travel-sample`(country, name) WHERE type = "hotel";
SELECT country, name, type, META().id
FROM `travel-sample`
WHERE type = "hotel" AND country = "United States";
Regular Secondary Scan
‱ Indexes in with most number of matching index keys are used
‱ When more than one index are qualified, IntersectScan is used.
‱ To avoid IntersectScan provide hint with USE INDEX.
SELECT country, name, type, META().id, phone
FROM `travel-sample`
WHERE type = "hotel" AND country = "United States";
12
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 13
©2016 Couchbase Inc.
Scan Methods
UNNEST Scan
‱ Only array indexes are considered. And only queries with UNNEST clauses are considered
Index Count Scan
‱ Queries with single projection of COUNT aggregate, NO JOIN’s, GROUP BY is considered
‱ Chosen Index needs to be covered with single range, exact range will be able to push to indexer and
argument to COUNT needs to be constant or leading key
SELECT COUNT(1)
FROM `travel-sample`
WHERE type = "hotel" AND country = "United States";
13
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
2 IMPROVMENTS IN
5.0
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 15
UnionScan
‱ OR predicate can use multiple indexes.
‱ Each Index perform IndexScan and results are merged using
UnionScan.
‱ Each IndexScan can push variable length of index keys.
‱ All IndexScan under UnionScan are covered the UnionScan
is covered.
‱ CREATE INDEX ts_cc ON `travel-sample` (country, city)
WHERE type = "hotel";
‱ CREATE INDEX ts_n ON `travel-sample` (name) WHERE
type = "hotel";
EXPLAIN SELECT name, country, city
FROM `travel-sample`
WHERE type = "hotel" AND
((country = "United States" AND city = "San Francisco")
OR (name = "White Wolf"));
{ "#operator": "UnionScan",
"scans": [{ "index": "ts_cc",
"spans": [ { "range": [
{ "high": ""United States"",
"inclusion": 3, "low": ""United States"" },
{ "high": ""San Francisco"",
"inclusion": 3, "low": ""San Francisco"" } ]
} ],
},
{ "index": "ts_n",
"spans": [ { "range": [ { "high": ""White
Wolf"", "inclusion": 3, "low": ""White Wolf"" } ] }],
} ]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 16
IntersectScan
‱ IntersectScan is improved by terminating scans early when
one of the scan completed or limit is reached. Also only
completed scan results are considered as possible
candidates.
‱ If query has ORDER BY and predicate on the order by
clausesand when possible it uses OrderedIntersectScan.
EXPLAIN
SELECT name, country, city
FROM `travel-sample`
WHERE type = "hotel" AND
country = "United States" AND
city = "San Francisco" AND
name >= "White Wolf"
ORDER BY name;
{ "#operator": "OrderedIntersectScan",
"scans": [ { "index": "ts_n",
"spans": [ {
"range": [ { "inclusion": 1,
"low": ""White Wolf"" } ] } ],
},
{ "index": "ts_cc",
"spans": [ {
"range": [ { "high": ""United States"",
"inclusion": 3, "low": ""United States"" },
{ "high": ""San Francisco"",
"inclusion": 3, "low": ""San Francisco"" } ]
} ],
} ]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 17
Implicit Covering Array Index
‱ N1QL supports simplified Implicit Covering Array
Index syntax in certain cases where the mandatory
array index-key requirement is relaxed to create a
covering array-index.
‱ The predicates that can be exactly and completely
pushed to the indexer during the array index scan.
‱ No false positives
CREATE INDEX ts_r_simple ON `travel-sample` ( DISTINCT
ARRAY v.flight FOR v IN schedule END) WHERE type = "route";
EXPLAIN SELECT meta().id
FROM `travel-sample`
WHERE type = "route" AND
ANY v IN schedule SATISFIES v.flight LIKE 'UA%'
END;
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 18
Stable Scans
Earlier versions IndexScan use to do single range scan
(i.e single Span)
If the query has multiple ranges (i.e. OR, IN, NOT
clauses) N1QL use to do separate IndexScan for each
range.
‱ This causes Indexer can use different snapshot
for each scan (make it unstable scan)
‱ Number of IndexScans are higher, result in
increase in index connections.
In 5.0.0 multiple ranges are passed into indexer and
indexer uses same snapshot for all the ranges.
If Explain shows operator IndexScan2, It uses stables
Scans.
EXPLAIN SELECT name, country, city
FROM `travel-sample`
WHERE type = "hotel" AND
country IN ["United States" , "France"];
{ "#operator": "IndexScan2",
"index": "ts_cc",
"spans": [
{ "range": [ { "high": ""France"",
"inclusion": 3,
"low": ""France""
}]
},
{ "range": [ { "high": ""United States"",
"inclusion": 3,
"low": ""United States""
}]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 19
Efficiently Pushdown Composite Filters
‱ Earlier versions composite Index the spans that
pushed to indexer contains single range for all
composite keys together.
‱ Indexer will not applying range for each part of the
key separately. This may result in lot of false
positives.
‱ In 5.0.0 with IndexScan2 each index key range
separately pushed and indexer will apply keys
separately.
‱ This results in no/less false positives and aides push
more information to indexer.
EXPLAIN SELECT name, country, city
FROM `travel-sample`
WHERE type = "hotel" AND
country >= "United States" AND
city = "San Francisco";
{ "#operator": "IndexScan2",
"index": "ts_cc",
"spans": [
{ "range": [ {"inclusion": 1,
"low": ""United States""
},
{ "high": ""San Francisco"",
"inclusion": 3,
"low": ""San Francisco""
}
]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 20
Pagination (ORDER, OFFSET, LIMIT)
‱ Pagination queries can contain any combination of
ORDER, LIMIT, OFFSET clauses.
‱ Predicates are completely and exactly pushed to
indexer, by pushing offset, limit to indexer can
improve query performance significantly. If that
happened IndexScan2 section of EXPLAIN will have
limit, offset.
‱ If query ORDER BY matches index key order query
can exploit index order and avoid sort. If that
happened order operator is not present in the
EXPLAIN.
EXPLAIN SELECT country, city
FROM `travel-sample`
WHERE type = "hotel" AND
country >= "United States"
ORDER BY country, city
OFFSET 1 LIMIT 10;
{ "#operator": "IndexScan2",
"index": "ts_cc",
"limit": "10",
"offset": "1",
"spans": [
{ "range": [ {"inclusion": 1,
"low": ""United States""
}
]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 21
DESC Index Collation
‱ Index can be created with ASC/DESC collation on
each index key
‱ Query can utilize index collation
CREATE INDEX ts_acc ON `travel-sample` (country DESC,
city ASC) WHERE type = "airline";
EXPLAIN SELECT country, city
FROM `travel-sample`
WHERE type = "airline" AND
country >= "United States"
ORDER BY country DESC , city
OFFSET 1 LIMIT 10;
{ "#operator": "IndexScan2",
"index": "ts_acc",
"limit": "10",
"offset": "1",
"spans": [
{ "range": [ {"inclusion": 1,
"low": ""United States""
}
]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 22
MAX pushdown
‱ If the MAX arguments matched with Index leading
key exploit index order for MAX.
‱ MAX can only be use DESC on leading index key.
‱ MIN can only be use ASC on leading index key.
‱ If pushdown happens "limit: 1 will appear in
IndexScan2 section of the EXPLAIN.
CREATE INDEX ts_acc ON `travel-sample` (country DESC,
city ASC) WHERE type = "airline";
EXPLAIN SELECT MAX(country)
FROM `travel-sample`
WHERE type = "airline" AND
country >= "United States";
{ "#operator": "IndexScan2",
"index": "ts_acc",
"limit": "1",
"spans": [
{ "range": [ {"inclusion": 1,
"low": ""United States""
}
]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 23
COUNT (DISTINCT expr)
‱ If the expr matched with Index leading key, COUNT
DISTINCT can be pushed to indexer
‱ Complete predicates needs to pushed to indexer exactly
‱ No false positives are possible
‱ No group or JOIN
‱ Only single projection
‱ When pushdown IndexCountDistinctScan2 will
appear in EXPLAIN
EXPLAIN SELECT COUNT( DISTINCT country)
FROM `travel-sample`
WHERE type = "hotel" AND
country >= "United States";
{
"#operator": "IndexCountDistinctScan2"
"index": "ts_cc",
"spans": [
{ "range": [ {"inclusion": 1,
"low": ""United States""
}
]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 24
Index Projection
‱ The index can have many keys but query might be
interested only subset of keys.
‱ By only requesting required information from indexer
can save lot of network transportation, memory, cpu,
backfill etc. All this can help in performance and
scaling the cluster.
‱ The requested information can be found in
"IndexScan2" Section of EXPLAIN as
"index_projection"
"index_projection": {
"entry_keys": [ xxx,....... ]
"primary_key": true
}
EXPLAIN SELECT country FROM `travel-sample`
WHERE type = "hotel" AND country >= "United
States";
"index_projection": { "entry_keys": [ 0 ] }
EXPLAIN SELECT country,city FROM `travel-sample`
WHERE type = "hotel" AND country >= "United
States" ;
"index_projection": { "entry_keys": [ 0 ,1] }
EXPLAIN SELECT country,city, META().id FROM `travel-
sample`
WHERE type = "hotel" AND country >= "United
States" ;
"index_projection": { "entry_keys": [ 0 ,1], "primary_key":true }
EXPLAIN SELECT country,city, META().id, name
FROM `travel-sample`
WHERE type = "hotel" AND country >= "United
States" ;
non covered query
"index_projection": {"primary_key":true }
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 25
Index Cas and Expiration
‱ META().cas, META().expiration can be indexed and
used in queries.
‱ Note: META().expiration will work in covered queries.
For non covered queries it gives 0
CREATE INDEX ts_cas ON `travel-sample` (country,
META().cas, META().expiration) WHERE type = "airport";
EXPLAIN SELECT country, META().cas, META().expiration
FROM `travel-sample`
WHERE type = "airport" AND country = "United
States";
{
"#operator": "IndexScan2"
"index": "ts_cas",
"spans": [
{ "range": [ { "high": ""United States""
"inclusion": 3,
"low": ""United States""
}
]
}
]
}
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
3 Q&A
Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved.
THANK
YOU

Mais conteĂșdo relacionado

Mais procurados

Webinar: What's New in Solr 6
Webinar: What's New in Solr 6Webinar: What's New in Solr 6
Webinar: What's New in Solr 6Lucidworks
 
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, ClouderaParallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, ClouderaLucidworks
 
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Yonik Seeley
 
Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...
Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...
Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...Lucidworks
 
ElasticSearch AJUG 2013
ElasticSearch AJUG 2013ElasticSearch AJUG 2013
ElasticSearch AJUG 2013Roy Russo
 
Simple search with elastic search
Simple search with elastic searchSimple search with elastic search
Simple search with elastic searchmarkstory
 
Simple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis Technology
Simple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis TechnologySimple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis Technology
Simple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis TechnologyLucidworks
 
Data Science with Solr and Spark
Data Science with Solr and SparkData Science with Solr and Spark
Data Science with Solr and SparkLucidworks
 
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Lucidworks
 
How to integrate Splunk with any data solution
How to integrate Splunk with any data solutionHow to integrate Splunk with any data solution
How to integrate Splunk with any data solutionJulian Hyde
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchJason Austin
 
Elasticsearch in 15 minutes
Elasticsearch in 15 minutesElasticsearch in 15 minutes
Elasticsearch in 15 minutesDavid Pilato
 
Cassandra 3 new features 2016
Cassandra 3 new features 2016Cassandra 3 new features 2016
Cassandra 3 new features 2016Duyhai Doan
 
Solr 6 Feature Preview
Solr 6 Feature PreviewSolr 6 Feature Preview
Solr 6 Feature PreviewYonik Seeley
 
Creating New Streams: Presented by Dennis Gove, Bloomberg LP
Creating New Streams: Presented by Dennis Gove, Bloomberg LPCreating New Streams: Presented by Dennis Gove, Bloomberg LP
Creating New Streams: Presented by Dennis Gove, Bloomberg LPLucidworks
 
Query DSL In Elasticsearch
Query DSL In ElasticsearchQuery DSL In Elasticsearch
Query DSL In ElasticsearchKnoldus Inc.
 
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UNSolr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UNLucidworks
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1Charles Givre
 
Retrieving Information From Solr
Retrieving Information From SolrRetrieving Information From Solr
Retrieving Information From SolrRamzi Alqrainy
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to ElasticsearchSperasoft
 

Mais procurados (20)

Webinar: What's New in Solr 6
Webinar: What's New in Solr 6Webinar: What's New in Solr 6
Webinar: What's New in Solr 6
 
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, ClouderaParallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
Parallel SQL and Analytics with Solr: Presented by Yonik Seeley, Cloudera
 
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
Native Code, Off-Heap Data & JSON Facet API for Solr (Heliosearch)
 
Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...
Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...
Streaming Aggregation in Solr - New Horizons for Search: Presented by Erick E...
 
ElasticSearch AJUG 2013
ElasticSearch AJUG 2013ElasticSearch AJUG 2013
ElasticSearch AJUG 2013
 
Simple search with elastic search
Simple search with elastic searchSimple search with elastic search
Simple search with elastic search
 
Simple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis Technology
Simple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis TechnologySimple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis Technology
Simple Fuzzy Name Matching in Solr: Presented by Chris Mack, Basis Technology
 
Data Science with Solr and Spark
Data Science with Solr and SparkData Science with Solr and Spark
Data Science with Solr and Spark
 
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
Rebuilding Solr 6 Examples - Layer by Layer: Presented by Alexandre Rafalovit...
 
How to integrate Splunk with any data solution
How to integrate Splunk with any data solutionHow to integrate Splunk with any data solution
How to integrate Splunk with any data solution
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Elasticsearch in 15 minutes
Elasticsearch in 15 minutesElasticsearch in 15 minutes
Elasticsearch in 15 minutes
 
Cassandra 3 new features 2016
Cassandra 3 new features 2016Cassandra 3 new features 2016
Cassandra 3 new features 2016
 
Solr 6 Feature Preview
Solr 6 Feature PreviewSolr 6 Feature Preview
Solr 6 Feature Preview
 
Creating New Streams: Presented by Dennis Gove, Bloomberg LP
Creating New Streams: Presented by Dennis Gove, Bloomberg LPCreating New Streams: Presented by Dennis Gove, Bloomberg LP
Creating New Streams: Presented by Dennis Gove, Bloomberg LP
 
Query DSL In Elasticsearch
Query DSL In ElasticsearchQuery DSL In Elasticsearch
Query DSL In Elasticsearch
 
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UNSolr vs. Elasticsearch,  Case by Case: Presented by Alexandre Rafalovitch, UN
Solr vs. Elasticsearch, Case by Case: Presented by Alexandre Rafalovitch, UN
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1
 
Retrieving Information From Solr
Retrieving Information From SolrRetrieving Information From Solr
Retrieving Information From Solr
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 

Semelhante a N1QL Query Optimizer Improvements in Couchbase 5.0

N1QL workshop: Indexing & Query turning.
N1QL workshop: Indexing & Query turning.N1QL workshop: Indexing & Query turning.
N1QL workshop: Indexing & Query turning.Keshav Murthy
 
Understanding N1QL Optimizer to Tune Queries
Understanding N1QL Optimizer to Tune QueriesUnderstanding N1QL Optimizer to Tune Queries
Understanding N1QL Optimizer to Tune QueriesKeshav Murthy
 
Monitoring Modern Applications: Introduction to AWS X-Ray
Monitoring Modern Applications: Introduction to AWS X-RayMonitoring Modern Applications: Introduction to AWS X-Ray
Monitoring Modern Applications: Introduction to AWS X-RayAmazon Web Services
 
SplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search OptimizationSplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search OptimizationSplunk
 
Tuning for Performance: indexes & Queries
Tuning for Performance: indexes & QueriesTuning for Performance: indexes & Queries
Tuning for Performance: indexes & QueriesKeshav Murthy
 
OQL querying and indexes with Apache Geode (incubating)
OQL querying and indexes with Apache Geode (incubating)OQL querying and indexes with Apache Geode (incubating)
OQL querying and indexes with Apache Geode (incubating)Jason Huynh
 
State of Florida Neo4j Graph Briefing - Cyber IAM
State of Florida Neo4j Graph Briefing - Cyber IAMState of Florida Neo4j Graph Briefing - Cyber IAM
State of Florida Neo4j Graph Briefing - Cyber IAMNeo4j
 
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...DataStax
 
MySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer GuideMySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer GuideMorgan Tocker
 
Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems MongoDB
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterMongoDB
 
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014Andrés de la Peña
 
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014dhiguero
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Test strategy utilising mc useful tools
Test strategy utilising mc useful toolsTest strategy utilising mc useful tools
Test strategy utilising mc useful toolsMark Chappell
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBIntroducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBMongoDB
 
Data saturday malta - ADX Azure Data Explorer overview
Data saturday malta - ADX Azure Data Explorer overviewData saturday malta - ADX Azure Data Explorer overview
Data saturday malta - ADX Azure Data Explorer overviewRiccardo Zamana
 
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query Pitfalls
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query PitfallsMongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query Pitfalls
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query PitfallsMongoDB
 
Saltconf16 william-cannon b
Saltconf16 william-cannon bSaltconf16 william-cannon b
Saltconf16 william-cannon bWilliam Cannon
 

Semelhante a N1QL Query Optimizer Improvements in Couchbase 5.0 (20)

N1QL workshop: Indexing & Query turning.
N1QL workshop: Indexing & Query turning.N1QL workshop: Indexing & Query turning.
N1QL workshop: Indexing & Query turning.
 
Understanding N1QL Optimizer to Tune Queries
Understanding N1QL Optimizer to Tune QueriesUnderstanding N1QL Optimizer to Tune Queries
Understanding N1QL Optimizer to Tune Queries
 
Monitoring Modern Applications: Introduction to AWS X-Ray
Monitoring Modern Applications: Introduction to AWS X-RayMonitoring Modern Applications: Introduction to AWS X-Ray
Monitoring Modern Applications: Introduction to AWS X-Ray
 
SplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search OptimizationSplunkSummit 2015 - A Quick Guide to Search Optimization
SplunkSummit 2015 - A Quick Guide to Search Optimization
 
Tuning for Performance: indexes & Queries
Tuning for Performance: indexes & QueriesTuning for Performance: indexes & Queries
Tuning for Performance: indexes & Queries
 
OQL querying and indexes with Apache Geode (incubating)
OQL querying and indexes with Apache Geode (incubating)OQL querying and indexes with Apache Geode (incubating)
OQL querying and indexes with Apache Geode (incubating)
 
State of Florida Neo4j Graph Briefing - Cyber IAM
State of Florida Neo4j Graph Briefing - Cyber IAMState of Florida Neo4j Graph Briefing - Cyber IAM
State of Florida Neo4j Graph Briefing - Cyber IAM
 
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
Cassandra Tools and Distributed Administration (Jeffrey Berger, Knewton) | C*...
 
sigir16
sigir16sigir16
sigir16
 
MySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer GuideMySQL 8.0 Optimizer Guide
MySQL 8.0 Optimizer Guide
 
Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems Using Compass to Diagnose Performance Problems
Using Compass to Diagnose Performance Problems
 
Using Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your ClusterUsing Compass to Diagnose Performance Problems in Your Cluster
Using Compass to Diagnose Performance Problems in Your Cluster
 
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
 
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
Advanced search and Top-k queries in Cassandra - Cassandra Summit Europe 2014
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Test strategy utilising mc useful tools
Test strategy utilising mc useful toolsTest strategy utilising mc useful tools
Test strategy utilising mc useful tools
 
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDBIntroducing MongoDB Stitch, Backend-as-a-Service from MongoDB
Introducing MongoDB Stitch, Backend-as-a-Service from MongoDB
 
Data saturday malta - ADX Azure Data Explorer overview
Data saturday malta - ADX Azure Data Explorer overviewData saturday malta - ADX Azure Data Explorer overview
Data saturday malta - ADX Azure Data Explorer overview
 
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query Pitfalls
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query PitfallsMongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query Pitfalls
MongoDB.local DC 2018: Tips and Tricks for Avoiding Common Query Pitfalls
 
Saltconf16 william-cannon b
Saltconf16 william-cannon bSaltconf16 william-cannon b
Saltconf16 william-cannon b
 

Mais de Keshav Murthy

N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0Keshav Murthy
 
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Keshav Murthy
 
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...Keshav Murthy
 
From SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONFrom SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONKeshav Murthy
 
Utilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingUtilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingKeshav Murthy
 
Extended JOIN in Couchbase Server 4.5
Extended JOIN in Couchbase Server 4.5Extended JOIN in Couchbase Server 4.5
Extended JOIN in Couchbase Server 4.5Keshav Murthy
 
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQLBringing SQL to NoSQL: Rich, Declarative Query for NoSQL
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQLKeshav Murthy
 
Query in Couchbase. N1QL: SQL for JSON
Query in Couchbase.  N1QL: SQL for JSONQuery in Couchbase.  N1QL: SQL for JSON
Query in Couchbase. N1QL: SQL for JSONKeshav Murthy
 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications Keshav Murthy
 
Introducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONIntroducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONKeshav Murthy
 
Enterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QLEnterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QLKeshav Murthy
 
Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.Keshav Murthy
 
Drilling on JSON
Drilling on JSONDrilling on JSON
Drilling on JSONKeshav Murthy
 
Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data. Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data. Keshav Murthy
 
You know what iMEAN? Using MEAN stack for application dev on Informix
You know what iMEAN? Using MEAN stack for application dev on InformixYou know what iMEAN? Using MEAN stack for application dev on Informix
You know what iMEAN? Using MEAN stack for application dev on InformixKeshav Murthy
 
Informix SQL & NoSQL: Putting it all together
Informix SQL & NoSQL: Putting it all togetherInformix SQL & NoSQL: Putting it all together
Informix SQL & NoSQL: Putting it all togetherKeshav Murthy
 
Informix SQL & NoSQL -- for Chat with the labs on 4/22
Informix SQL & NoSQL -- for Chat with the labs on 4/22Informix SQL & NoSQL -- for Chat with the labs on 4/22
Informix SQL & NoSQL -- for Chat with the labs on 4/22Keshav Murthy
 
NoSQL Deepdive - with Informix NoSQL. IOD 2013
NoSQL Deepdive - with Informix NoSQL. IOD 2013NoSQL Deepdive - with Informix NoSQL. IOD 2013
NoSQL Deepdive - with Informix NoSQL. IOD 2013Keshav Murthy
 
Informix NoSQL & Hybrid SQL detailed deep dive
Informix NoSQL & Hybrid SQL detailed deep diveInformix NoSQL & Hybrid SQL detailed deep dive
Informix NoSQL & Hybrid SQL detailed deep diveKeshav Murthy
 
Table for two? Hybrid approach to developing combined SQL, NoSQL applications...
Table for two? Hybrid approach to developing combined SQL, NoSQL applications...Table for two? Hybrid approach to developing combined SQL, NoSQL applications...
Table for two? Hybrid approach to developing combined SQL, NoSQL applications...Keshav Murthy
 

Mais de Keshav Murthy (20)

N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0N1QL New Features in couchbase 7.0
N1QL New Features in couchbase 7.0
 
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018Couchbase Tutorial: Big data Open Source Systems: VLDB2018
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
 
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
 
From SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSONFrom SQL to NoSQL: Structured Querying for JSON
From SQL to NoSQL: Structured Querying for JSON
 
Utilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and IndexingUtilizing Arrays: Modeling, Querying and Indexing
Utilizing Arrays: Modeling, Querying and Indexing
 
Extended JOIN in Couchbase Server 4.5
Extended JOIN in Couchbase Server 4.5Extended JOIN in Couchbase Server 4.5
Extended JOIN in Couchbase Server 4.5
 
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQLBringing SQL to NoSQL: Rich, Declarative Query for NoSQL
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
 
Query in Couchbase. N1QL: SQL for JSON
Query in Couchbase.  N1QL: SQL for JSONQuery in Couchbase.  N1QL: SQL for JSON
Query in Couchbase. N1QL: SQL for JSON
 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
 
Introducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSONIntroducing N1QL: New SQL Based Query Language for JSON
Introducing N1QL: New SQL Based Query Language for JSON
 
Enterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QLEnterprise Architect's view of Couchbase 4.0 with N1QL
Enterprise Architect's view of Couchbase 4.0 with N1QL
 
Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.Deep dive into N1QL: SQL for JSON: Internals and power features.
Deep dive into N1QL: SQL for JSON: Internals and power features.
 
Drilling on JSON
Drilling on JSONDrilling on JSON
Drilling on JSON
 
Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data. Accelerating analytics on the Sensor and IoT Data.
Accelerating analytics on the Sensor and IoT Data.
 
You know what iMEAN? Using MEAN stack for application dev on Informix
You know what iMEAN? Using MEAN stack for application dev on InformixYou know what iMEAN? Using MEAN stack for application dev on Informix
You know what iMEAN? Using MEAN stack for application dev on Informix
 
Informix SQL & NoSQL: Putting it all together
Informix SQL & NoSQL: Putting it all togetherInformix SQL & NoSQL: Putting it all together
Informix SQL & NoSQL: Putting it all together
 
Informix SQL & NoSQL -- for Chat with the labs on 4/22
Informix SQL & NoSQL -- for Chat with the labs on 4/22Informix SQL & NoSQL -- for Chat with the labs on 4/22
Informix SQL & NoSQL -- for Chat with the labs on 4/22
 
NoSQL Deepdive - with Informix NoSQL. IOD 2013
NoSQL Deepdive - with Informix NoSQL. IOD 2013NoSQL Deepdive - with Informix NoSQL. IOD 2013
NoSQL Deepdive - with Informix NoSQL. IOD 2013
 
Informix NoSQL & Hybrid SQL detailed deep dive
Informix NoSQL & Hybrid SQL detailed deep diveInformix NoSQL & Hybrid SQL detailed deep dive
Informix NoSQL & Hybrid SQL detailed deep dive
 
Table for two? Hybrid approach to developing combined SQL, NoSQL applications...
Table for two? Hybrid approach to developing combined SQL, NoSQL applications...Table for two? Hybrid approach to developing combined SQL, NoSQL applications...
Table for two? Hybrid approach to developing combined SQL, NoSQL applications...
 

Último

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžDelhi Call girls
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfWilly Marroquin (WillyDevNET)
 
CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂
CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂
CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂anilsa9823
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 

Último (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïžcall girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
call girls in Vaishali (Ghaziabad) 🔝 >àŒ’8448380779 🔝 genuine Escort Service đŸ”âœ”ïžâœ”ïž
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂
CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂
CALL ON ➄8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 

N1QL Query Optimizer Improvements in Couchbase 5.0

  • 1. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. N1QL QUERY OPTIMIZER AND IMPROVMENTS IN 5.0
  • 2. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. AGENDA 01/ 02 03 Optimizer Overview Improvements in 5.0 Q&A
  • 3. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 1 OPTIMIZER OVERVIEW
  • 4. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 4 Query Execution Flow
  • 5. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 5 Query Service
  • 6. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 6 Query Execution Phases
  • 7. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 7 Optimizer ‱ Query Rewrite ‱ N1QL does very limited rewrite. ‱ Access Path Selection ‱ KeyScan Access ‱ IndexScan Access ‱ PrimaryScan Access ‱ JOIN ORDER, Types and Methods ‱ The keyspaces specified in the FROM clause are joined in the exact order given in the query. ‱ Nested Loop Join ‱ LOOK UP JOIN ‱ Index JOIN ‱ Execution Plan
  • 8. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 8 Optimizer ‱ Optimizer considers all possible ways to execute query and decides best query plan. ‱ Query plan generated based on rule based optimization ‱ If index can’t satisfy the query that index will not be chosen. ‱ If an index scan can be performed, will not perform a full / primary scan. ‱ Each query block (i.e. SELECT
 ) has its own query plan
  • 9. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 9 Index Selection ‱ Online indexes ‱ Only online indexes are considered ‱ Preferred indexes ‱ USE INDEX hint is provided the indexes in that list are considered ‱ Satisfying Index condition ‱ Partial / filtered indexes that index condition is super set of query predicate are considered ‱ Satisfying Index keys ‱ Indexes whose leading keys satisfy query predicate are considered ‱ Longest satisfying index keys ‱ Redundancy is eliminated by keeping longest satisfying index keys in same order. ‱ Index with satisfying keys (a,b,c) is retained over index with satisfying (a,b)
  • 10. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 10 Access Path Selection ‱ Key Scan ‱ If the query contains a USE KEYS clause, no index scan or primary scan is performed. The input document keys are taken directly from the USE KEYS clause. ‱ Index Count Scan ‱ Covering Secondary Scan ‱ Regular secondary scan -- longest satisfying keys, intersect scan; ‱ To avoid IntersectScan, provide a hint with USE INDEX. ‱ UNNEST scan; ‱ Only array indexes with an index key matching the predicates are used for UNNEST scan. ‱ Regular primary scan ‱ If a primary scan is selected, and there is no primary index available, the query errors out.
  • 11. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 11 Scan Methods ‱ Covering Primary Scan ‱ A covering primary scan is a primary scan that does not perform a subsequent document fetch. It is used for queries that need a full / primary scan and only reference META().id. SELECT META(t).id FROM `travel-sample` t; ‱ Regular Primary Scan ‱ A regular primary scan also performs a subsequent document fetch. It is used for queries that need a full / primary scan and reference some document data other than META().id. SELECT META(t).cas FROM `travel-sample` t; SELECT * FROM `travel-sample` t;
  • 12. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 12 ©2016 Couchbase Inc. Scan Methods Covering Secondary Scan ‱ Each satisfied index with most number of index keys is examined for query coverage ‱ Shortest covering index will be used. CREATE INDEX ts_name ON `travel-sample`(country, name) WHERE type = "hotel"; SELECT country, name, type, META().id FROM `travel-sample` WHERE type = "hotel" AND country = "United States"; Regular Secondary Scan ‱ Indexes in with most number of matching index keys are used ‱ When more than one index are qualified, IntersectScan is used. ‱ To avoid IntersectScan provide hint with USE INDEX. SELECT country, name, type, META().id, phone FROM `travel-sample` WHERE type = "hotel" AND country = "United States"; 12
  • 13. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 13 ©2016 Couchbase Inc. Scan Methods UNNEST Scan ‱ Only array indexes are considered. And only queries with UNNEST clauses are considered Index Count Scan ‱ Queries with single projection of COUNT aggregate, NO JOIN’s, GROUP BY is considered ‱ Chosen Index needs to be covered with single range, exact range will be able to push to indexer and argument to COUNT needs to be constant or leading key SELECT COUNT(1) FROM `travel-sample` WHERE type = "hotel" AND country = "United States"; 13
  • 14. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 2 IMPROVMENTS IN 5.0
  • 15. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 15 UnionScan ‱ OR predicate can use multiple indexes. ‱ Each Index perform IndexScan and results are merged using UnionScan. ‱ Each IndexScan can push variable length of index keys. ‱ All IndexScan under UnionScan are covered the UnionScan is covered. ‱ CREATE INDEX ts_cc ON `travel-sample` (country, city) WHERE type = "hotel"; ‱ CREATE INDEX ts_n ON `travel-sample` (name) WHERE type = "hotel"; EXPLAIN SELECT name, country, city FROM `travel-sample` WHERE type = "hotel" AND ((country = "United States" AND city = "San Francisco") OR (name = "White Wolf")); { "#operator": "UnionScan", "scans": [{ "index": "ts_cc", "spans": [ { "range": [ { "high": ""United States"", "inclusion": 3, "low": ""United States"" }, { "high": ""San Francisco"", "inclusion": 3, "low": ""San Francisco"" } ] } ], }, { "index": "ts_n", "spans": [ { "range": [ { "high": ""White Wolf"", "inclusion": 3, "low": ""White Wolf"" } ] }], } ] }
  • 16. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 16 IntersectScan ‱ IntersectScan is improved by terminating scans early when one of the scan completed or limit is reached. Also only completed scan results are considered as possible candidates. ‱ If query has ORDER BY and predicate on the order by clausesand when possible it uses OrderedIntersectScan. EXPLAIN SELECT name, country, city FROM `travel-sample` WHERE type = "hotel" AND country = "United States" AND city = "San Francisco" AND name >= "White Wolf" ORDER BY name; { "#operator": "OrderedIntersectScan", "scans": [ { "index": "ts_n", "spans": [ { "range": [ { "inclusion": 1, "low": ""White Wolf"" } ] } ], }, { "index": "ts_cc", "spans": [ { "range": [ { "high": ""United States"", "inclusion": 3, "low": ""United States"" }, { "high": ""San Francisco"", "inclusion": 3, "low": ""San Francisco"" } ] } ], } ] }
  • 17. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 17 Implicit Covering Array Index ‱ N1QL supports simplified Implicit Covering Array Index syntax in certain cases where the mandatory array index-key requirement is relaxed to create a covering array-index. ‱ The predicates that can be exactly and completely pushed to the indexer during the array index scan. ‱ No false positives CREATE INDEX ts_r_simple ON `travel-sample` ( DISTINCT ARRAY v.flight FOR v IN schedule END) WHERE type = "route"; EXPLAIN SELECT meta().id FROM `travel-sample` WHERE type = "route" AND ANY v IN schedule SATISFIES v.flight LIKE 'UA%' END;
  • 18. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 18 Stable Scans Earlier versions IndexScan use to do single range scan (i.e single Span) If the query has multiple ranges (i.e. OR, IN, NOT clauses) N1QL use to do separate IndexScan for each range. ‱ This causes Indexer can use different snapshot for each scan (make it unstable scan) ‱ Number of IndexScans are higher, result in increase in index connections. In 5.0.0 multiple ranges are passed into indexer and indexer uses same snapshot for all the ranges. If Explain shows operator IndexScan2, It uses stables Scans. EXPLAIN SELECT name, country, city FROM `travel-sample` WHERE type = "hotel" AND country IN ["United States" , "France"]; { "#operator": "IndexScan2", "index": "ts_cc", "spans": [ { "range": [ { "high": ""France"", "inclusion": 3, "low": ""France"" }] }, { "range": [ { "high": ""United States"", "inclusion": 3, "low": ""United States"" }] } ] }
  • 19. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 19 Efficiently Pushdown Composite Filters ‱ Earlier versions composite Index the spans that pushed to indexer contains single range for all composite keys together. ‱ Indexer will not applying range for each part of the key separately. This may result in lot of false positives. ‱ In 5.0.0 with IndexScan2 each index key range separately pushed and indexer will apply keys separately. ‱ This results in no/less false positives and aides push more information to indexer. EXPLAIN SELECT name, country, city FROM `travel-sample` WHERE type = "hotel" AND country >= "United States" AND city = "San Francisco"; { "#operator": "IndexScan2", "index": "ts_cc", "spans": [ { "range": [ {"inclusion": 1, "low": ""United States"" }, { "high": ""San Francisco"", "inclusion": 3, "low": ""San Francisco"" } ] } ] }
  • 20. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 20 Pagination (ORDER, OFFSET, LIMIT) ‱ Pagination queries can contain any combination of ORDER, LIMIT, OFFSET clauses. ‱ Predicates are completely and exactly pushed to indexer, by pushing offset, limit to indexer can improve query performance significantly. If that happened IndexScan2 section of EXPLAIN will have limit, offset. ‱ If query ORDER BY matches index key order query can exploit index order and avoid sort. If that happened order operator is not present in the EXPLAIN. EXPLAIN SELECT country, city FROM `travel-sample` WHERE type = "hotel" AND country >= "United States" ORDER BY country, city OFFSET 1 LIMIT 10; { "#operator": "IndexScan2", "index": "ts_cc", "limit": "10", "offset": "1", "spans": [ { "range": [ {"inclusion": 1, "low": ""United States"" } ] } ] }
  • 21. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 21 DESC Index Collation ‱ Index can be created with ASC/DESC collation on each index key ‱ Query can utilize index collation CREATE INDEX ts_acc ON `travel-sample` (country DESC, city ASC) WHERE type = "airline"; EXPLAIN SELECT country, city FROM `travel-sample` WHERE type = "airline" AND country >= "United States" ORDER BY country DESC , city OFFSET 1 LIMIT 10; { "#operator": "IndexScan2", "index": "ts_acc", "limit": "10", "offset": "1", "spans": [ { "range": [ {"inclusion": 1, "low": ""United States"" } ] } ] }
  • 22. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 22 MAX pushdown ‱ If the MAX arguments matched with Index leading key exploit index order for MAX. ‱ MAX can only be use DESC on leading index key. ‱ MIN can only be use ASC on leading index key. ‱ If pushdown happens "limit: 1 will appear in IndexScan2 section of the EXPLAIN. CREATE INDEX ts_acc ON `travel-sample` (country DESC, city ASC) WHERE type = "airline"; EXPLAIN SELECT MAX(country) FROM `travel-sample` WHERE type = "airline" AND country >= "United States"; { "#operator": "IndexScan2", "index": "ts_acc", "limit": "1", "spans": [ { "range": [ {"inclusion": 1, "low": ""United States"" } ] } ] }
  • 23. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 23 COUNT (DISTINCT expr) ‱ If the expr matched with Index leading key, COUNT DISTINCT can be pushed to indexer ‱ Complete predicates needs to pushed to indexer exactly ‱ No false positives are possible ‱ No group or JOIN ‱ Only single projection ‱ When pushdown IndexCountDistinctScan2 will appear in EXPLAIN EXPLAIN SELECT COUNT( DISTINCT country) FROM `travel-sample` WHERE type = "hotel" AND country >= "United States"; { "#operator": "IndexCountDistinctScan2" "index": "ts_cc", "spans": [ { "range": [ {"inclusion": 1, "low": ""United States"" } ] } ] }
  • 24. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 24 Index Projection ‱ The index can have many keys but query might be interested only subset of keys. ‱ By only requesting required information from indexer can save lot of network transportation, memory, cpu, backfill etc. All this can help in performance and scaling the cluster. ‱ The requested information can be found in "IndexScan2" Section of EXPLAIN as "index_projection" "index_projection": { "entry_keys": [ xxx,....... ] "primary_key": true } EXPLAIN SELECT country FROM `travel-sample` WHERE type = "hotel" AND country >= "United States"; "index_projection": { "entry_keys": [ 0 ] } EXPLAIN SELECT country,city FROM `travel-sample` WHERE type = "hotel" AND country >= "United States" ; "index_projection": { "entry_keys": [ 0 ,1] } EXPLAIN SELECT country,city, META().id FROM `travel- sample` WHERE type = "hotel" AND country >= "United States" ; "index_projection": { "entry_keys": [ 0 ,1], "primary_key":true } EXPLAIN SELECT country,city, META().id, name FROM `travel-sample` WHERE type = "hotel" AND country >= "United States" ; non covered query "index_projection": {"primary_key":true }
  • 25. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 25 Index Cas and Expiration ‱ META().cas, META().expiration can be indexed and used in queries. ‱ Note: META().expiration will work in covered queries. For non covered queries it gives 0 CREATE INDEX ts_cas ON `travel-sample` (country, META().cas, META().expiration) WHERE type = "airport"; EXPLAIN SELECT country, META().cas, META().expiration FROM `travel-sample` WHERE type = "airport" AND country = "United States"; { "#operator": "IndexScan2" "index": "ts_cas", "spans": [ { "range": [ { "high": ""United States"" "inclusion": 3, "low": ""United States"" } ] } ] }
  • 26. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. 3 Q&A
  • 27. Confidential and Proprietary. Do not distribute without Couchbase consent. © Couchbase 2017. All rights reserved. THANK YOU