couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebastian Cohnen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-812) implement randomization in views resultset
Date Mon, 28 Jun 2010 16:34:50 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12883209#action_12883209
] 

Sebastian Cohnen commented on COUCHDB-812:
------------------------------------------

It strongly depends on your particular use-case.

But if you really need to fetch large sets of purely random stuff, this is always going to
be a huge performance penalty, since you cannot utilize indexes and stuff. If you want to
avoid network overhead, you can use external processes [1] to do that for you. You could query
your external process via couchdb, let the process build the set and send it back to you in
one chunk.


[1] http://wiki.apache.org/couchdb/ExternalProcesses

> 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.


Mime
View raw message