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

[N1QL] advise could give an create statement with an index name that already exists

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Major
    • bug-backlog
    • 6.5.0
    • query
    • 6.5.0-3415
    • Untriaged
    • No

    Description

      repro:
      1.enable dp
      2.load travel-sample
      3.create an index CREATE INDEX adv_sourceairport_airlineid ON `travel-sample`(fake)
      4.run advise for this statement
      advise SELECT * FROM `travel-sample` r JOIN `travel-sample` a ON r.airlineid = META(a).id WHERE r.sourceairport = "SFO"

      advise statement will STILL give you this output

      "recommended_indexes": {
      "indexes": [
      {
      "index_statement": "CREATE INDEX adv_airlineid_sourceairport ON `travel-sample`(`airlineid`,`sourceairport`)",

      ^ above create index statement would not work if copy and pasted because that index name already exists in your index list

      Attachments

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

        Activity

          People

            chang.liu Chang Liu (Inactive)
            ajay.bhullar Ajay Bhullar
            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