Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-22992

[N1QL] Explain plan still shows (meta(`default`).`expiry`) though index was created on meta().expiration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 5.0.0
    • 5.0.0
    • query
    • None
    •  5.0.0-2079
    • Untriaged
    • No

    Description

      While testing meta().cas and meta().expiration, I found this issue:

      Indexes created:

      CREATE PRIMARY INDEX `#primary` ON `default`
       CREATE INDEX `idx2` ON `default`((meta().`expiration`))
      CREATE INDEX `idx3` ON `default`((meta().`id`),(meta().`cas`),(meta().`expiration`))
      CREATE INDEX `idx4` ON `default`((meta().`id`))
      
      

      Query issed:
      explain SELECT meta().id , meta().cas, meta().expiry FROM default where meta().id > "";

      Result terms in plan:

      "result_terms": [
                        {
                          "expr": "(meta(`default`).`id`)"
                        },
                        {
                          "expr": "(meta(`default`).`cas`)"
                        },
                        {
                          "expr": "(meta(`default`).`expiry`)"
                        }
                      ]
      

      It should have been "expr": "(meta(`default`).`expiration`)"

      It does return correct result when I replace meta().expiry with meta().expiration. Should expiry still be allowed with meta()?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Prerna.Manaktala Prerna Manaktala (Inactive)
            Prerna.Manaktala Prerna Manaktala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty