Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 50262 invoked from network); 28 Jun 2010 17:00:45 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 Jun 2010 17:00:45 -0000 Received: (qmail 4769 invoked by uid 500); 28 Jun 2010 17:00:45 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 4649 invoked by uid 500); 28 Jun 2010 17:00:44 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 4641 invoked by uid 99); 28 Jun 2010 17:00:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 17:00:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jun 2010 17:00:42 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o5SGqoS2020096 for ; Mon, 28 Jun 2010 16:52:51 GMT Message-ID: <9948012.95291277743970759.JavaMail.jira@thor> Date: Mon, 28 Jun 2010 12:52:50 -0400 (EDT) From: "Damien Katz (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Commented: (COUCHDB-812) implement randomization in views resultset In-Reply-To: <21804648.92751277736470455.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883212#action_12883212 ] Damien Katz commented on COUCHDB-812: ------------------------------------- I think this is a fairly useful feature. Many moons ago I needs something similar in Lotus Notes, to randomly display a document from the database. It was difficult to get working. It should be possible to do a random view get by randomly navigating btree nodes until you reach a leaf node. Though there will be some bias when the tree is unbalanced. > implement randomization in views resultset > ------------------------------------------ > > Key: COUCHDB-812 > URL: https://issues.apache.org/jira/browse/COUCHDB-812 > Project: CouchDB > Issue Type: Wish > Components: Database Core > Affects Versions: 0.11 > Environment: CouchDB > Reporter: Mickael Bailly > Priority: Minor > > 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. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.