Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-812

implement randomization in views resultset

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 0.11
    • None
    • Database Core
    • CouchDB

    • Regular Contributors Level (Easy to Medium)

    Description

      This is a proposal for a new feature in CouchDB : allow a randomization of rows in a view response. We can for example add a randomize query parameter...
      This request would probably not return the same results for the same request.

      As an example :

      GET /db/_design/doc/_view/example :
      {
      ..
      rows: [

      {key: 1 ...}

      ,

      {key: 2 ...}

      ,

      {key: 3 ...}

      ]
      }

      GET /db/_design/doc/_view/example?randomize=true :
      {
      ..
      rows: [

      {key: 2 ...}

      ,

      {key: 3 ...}

      ,

      {key: 1 ...}

      ]
      }

      GET /db/_design/doc/_view/example?randomize=true :
      {
      ..
      rows: [

      {key: 1 ...}

      ,

      {key: 3 ...}

      ,

      {key: 2 ...}

      ]
      }

      This is a feature hard to implement client-side (but by reading all doc ids and use client-side random function). It's implemented by the RDBMS from ages, probably for the very same reasons : if we should read all the rows client-side to random-select some of them, performances are awful.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mickael Michael Bailly
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: