Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.5.0
-
Triaged
-
Centos 64-bit
-
Unknown
Description
Build is 6.5.0-4471
Course of actions is this:
- Load `travel-sample` bucket
- Remove all indexes, primary and secondary
- Create index
CREATE INDEX `def_country` ON `travel-sample`(`country`)
|
- Start advisor() session
select ADVISOR({ 'action' : 'start','duration' : '1m'}) |
- run query
select * from `travel-sample` where country='United States' and type='airline' |
- wait until advisor() session is ended
- analyze session collected results
select ADVISOR( { "action" : "get", |
"session": "0f719cdc-394f-4f94-aa82-a419bb94869e" } ) |
just change session name with your own session name
This query gives me nothing, but:
- run advisor() query for single n1ql query
SELECT ADVISOR("select * from `travel-sample` where country='United States' and type='airline'") |
This query gives me an advise:
[
|
{
|
"$1": { |
"current_used_indexes": [ |
{
|
"index": "CREATE INDEX def_country ON `travel-sample`(`country`)", |
"statements": [ |
{
|
"run_count": 1, |
"statement": "select * from `travel-sample` where country='United States' and type='airline'" |
}
|
]
|
}
|
],
|
"recommended_indexes": [ |
{
|
"index": "CREATE INDEX adv_country_type ON `travel-sample`(`country`) WHERE `type` = 'airline'", |
"statements": [ |
{
|
"run_count": 1, |
"statement": "select * from `travel-sample` where country='United States' and type='airline'" |
}
|
]
|
}
|
]
|
}
|
}
|
]
|
I believe that advisor() function should work totally the same for single query and for session.