[jira] Commented: (COUCHDB-812) implement randomization in views resultset

2010-06-28 Thread Robert Newson (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12883169#action_12883169
 ] 

Robert Newson commented on COUCHDB-812:
---


This appears to be a niche requirement that can be achieved by the client or 
application that uses couchdb. I don't think it should be in core.

 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.



[jira] Commented: (COUCHDB-812) implement randomization in views resultset

2010-06-28 Thread Chris Anderson (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12883180#action_12883180
 ] 

Chris Anderson commented on COUCHDB-812:


I agree. This isn't done by CouchDB, because it will incur roughly the same 
big-O cost to do random on the server, as it would on the client.

To solve this, use a view with random keys, and paginate through it. You'll 
have static view, so you can only use it once, but it will be in random order.

With smaller datasets this would be an OK place to use a temp view.

 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.



[jira] Commented: (COUCHDB-812) implement randomization in views resultset

2010-06-28 Thread Mickael Bailly (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12883200#action_12883200
 ] 

Mickael Bailly commented on COUCHDB-812:


I _of course_ disagree with your point of view. The random ordering of results 
is implemented by any mainstream rdbms (mysql, postgresql, mssqlserver, oracle, 
db2...). Don't think it's for niche use cases. The static random views that 
I can use only once isn't even applicable in my particular app.

Of course, you decide, and I respect couch devs decisions, but I find the not 
interesting flagging of this feature a little fast :-)

If couchDB could provide a way for me to implement that (by some 
non-deterministic lists for example), it will be OK, but at the moment I 
can't do that as a couchdb user. 
For the big-O cost argument... I must admit I don't understand what that 
means... :-/ However I can imagine the big-network cost of retrieving all keys 
I'm interested in, pick some random ones client-side, and then fetch those 
docs... That's how my current implementation is.

Hope you'll reconsider adding this particular feature or a more generic 
non-deterministic list feature, even if performance is bad for you, it'll 
certainly be better than couch request + network IO + client code + couch 
request...?

Regards

 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.



[jira] Commented: (COUCHDB-812) implement randomization in views resultset

2010-06-28 Thread Sebastian Cohnen (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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.



[jira] Commented: (COUCHDB-812) implement randomization in views resultset

2010-06-28 Thread Damien Katz (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-812?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=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.