I get the same results. However, it's peculiar that I get results when I 
use the second path (which seems to be doing a full scan without any index 
-- it references the #alldocs which you mention). If I supply the first 
path, I just get an empty resultset using the index:

cbq> explain select * from loop_gateway where type='submission'

{

    "resultset": [

        {

            "input": {

                "expr": {

                    "left": {

                        "left": {

                            "path": "loop_gateway",

                            "type": "property"

                        },

                        "right": {

                            "path": "type",

                            "type": "property"

                        },

                        "type": "dot_member"

                    },

                    "right": {

                        "type": "literal_string",

                        "value": "submission"

                    },

                    "type": "equals"

                },

                "input": {

                    "as": "loop_gateway",

                    "bucket": "loop_gateway",

                    "ids": null,

                    "input": {

                        "as": "",

                        "bucket": "loop_gateway",

                        "cover": false,

                        "index": "type_team_index",

                        "pool": "default",

                        "ranges": [

                            {

                                "high": [

                                    "submission"

                                ],

                                "inclusion": "both",

                                "limit": 0,

                                "low": [

                                    "submission"

                                ]

                            }

                        ],

                        "type": "scan"

                    },

                    "pool": "default",

                    "projection": null,

                    "type": "fetch"

                },

                "type": "filter"

            },

            "result": [

                {

                    "as": "",

                    "expr": {

                        "path": "loop_gateway",

                        "type": "property"

                    },

                    "star": true

                }

            ],

            "type": "projector"

        }

    ],

    "info": [

        {

            "caller": "http_response:160",

            "code": 100,

            "key": "total_rows",

            "message": "1"

        },

        {

            "caller": "http_response:162",

            "code": 101,

            "key": "total_elapsed_time",

            "message": "1.2372ms"

        }

    ]

}


cbq> explain select * from loop_gateway where team='default';

{

    "resultset": [

        {

            "input": {

                "expr": {

                    "left": {

                        "left": {

                            "path": "loop_gateway",

                            "type": "property"

                        },

                        "right": {

                            "path": "team",

                            "type": "property"

                        },

                        "type": "dot_member"

                    },

                    "right": {

                        "type": "literal_string",

                        "value": "default"

                    },

                    "type": "equals"

                },

                "input": {

                    "as": "loop_gateway",

                    "bucket": "loop_gateway",

                    "ids": null,

                    "input": {

                        "as": "",

                        "bucket": "loop_gateway",

                        "cover": false,

                        "index": "#alldocs",

                        "pool": "default",

                        "ranges": null,

                        "type": "scan"

                    },

                    "pool": "default",

                    "projection": null,

                    "type": "fetch"

                },

                "type": "filter"

            },

            "result": [

                {

                    "as": "",

                    "expr": {

                        "path": "loop_gateway",

                        "type": "property"

                    },

                    "star": true

                }

            ],

            "type": "projector"

        }

    ],

    "info": [

        {

            "caller": "http_response:160",

            "code": 100,

            "key": "total_rows",

            "message": "1"

        },

        {

            "caller": "http_response:162",

            "code": 101,

            "key": "total_elapsed_time",

            "message": "837.994us"

        }

    ]

}

On Tuesday, July 15, 2014 9:45:16 AM UTC-7, Siri wrote:
>
> Hi,
>
> I think you may have hit a bug. The index name "all_docs" is a reserved 
> word, but it looks like there's no validation to prevent user from creating 
> an index with that name.
>
> Could you try using a different name for the index? That is, "create index 
> type_team_index on bucket(type, team)"
>
> Thanks!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to