You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "antirobotrobot (JIRA)" <ji...@apache.org> on 2008/06/19 20:27:48 UTC
[jira] Created: (COUCHDB-82) total_rows should be the number of
rows returned if the count parameter is not supplied
total_rows should be the number of rows returned if the count parameter is not supplied
---------------------------------------------------------------------------------------
Key: COUCHDB-82
URL: https://issues.apache.org/jira/browse/COUCHDB-82
Project: CouchDB
Issue Type: Bug
Components: Database Core
Reporter: antirobotrobot
I need the ability to paginate though a subset of a view. I make view requests with startkey, endkey, and count. I would like to paginate through these rows, but I cannot know the total rows between startkey and endkey without making an extra view which adds up the totals.
It would be much better if total_rows, returned in the view, reflected the number of rows that would be returned had the count parameter not been supplied.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-82) total_rows should be the number of
rows returned if the count parameter is not supplied
Posted by "antirobotrobot (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608055#action_12608055 ]
antirobotrobot commented on COUCHDB-82:
---------------------------------------
Why this is necessary: without it the majority of pagination use cases will require two requests. One map request to get the rows, and a second map-reduce request to calculate the total rows.
Imagine a livejournal-like application with blog posts owned by different users. We want a paginated view of a single user's posts. Certainly one view could be made which does
emit( [doc.user_id, doc.post_date], doc );
And we can query all of the posts of John using startkey=["john"] endkey=["john", []]. Happily CouchDB tries to solve pagination for us, so we attached count=10 to the view query to get the first 10 posts of john. However, the total_rows parameter returned by the request tells us how many posts there are in total, not how many John has. This can be solved with a second request. Or alternatively it could be solved by having a view for each user on livejournal.
> total_rows should be the number of rows returned if the count parameter is not supplied
> ---------------------------------------------------------------------------------------
>
> Key: COUCHDB-82
> URL: https://issues.apache.org/jira/browse/COUCHDB-82
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core
> Reporter: antirobotrobot
>
> I need the ability to paginate though a subset of a view. I make view requests with startkey, endkey, and count. I would like to paginate through these rows, but I cannot know the total rows between startkey and endkey without making an extra view which adds up the totals.
> It would be much better if total_rows, returned in the view, reflected the number of rows that would be returned had the count parameter not been supplied.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-82) total_rows should be the number of
rows returned if the count parameter is not supplied
Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-82?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629437#action_12629437 ]
Jan Lehnardt commented on COUCHDB-82:
-------------------------------------
CouchDB streams view results directly from the index to the client, there is no way to know in advance how big a result set is and buffering everything to do a count is not a good idea. won't fix. a workaround is a reduce function to do the counting for you.
> total_rows should be the number of rows returned if the count parameter is not supplied
> ---------------------------------------------------------------------------------------
>
> Key: COUCHDB-82
> URL: https://issues.apache.org/jira/browse/COUCHDB-82
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core
> Reporter: antirobotrobot
>
> I need the ability to paginate though a subset of a view. I make view requests with startkey, endkey, and count. I would like to paginate through these rows, but I cannot know the total rows between startkey and endkey without making an extra view which adds up the totals.
> It would be much better if total_rows, returned in the view, reflected the number of rows that would be returned had the count parameter not been supplied.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (COUCHDB-82) total_rows should be the number of rows
returned if the count parameter is not supplied
Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COUCHDB-82?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jan Lehnardt closed COUCHDB-82.
-------------------------------
Resolution: Won't Fix
> total_rows should be the number of rows returned if the count parameter is not supplied
> ---------------------------------------------------------------------------------------
>
> Key: COUCHDB-82
> URL: https://issues.apache.org/jira/browse/COUCHDB-82
> Project: CouchDB
> Issue Type: Bug
> Components: Database Core
> Reporter: antirobotrobot
>
> I need the ability to paginate though a subset of a view. I make view requests with startkey, endkey, and count. I would like to paginate through these rows, but I cannot know the total rows between startkey and endkey without making an extra view which adds up the totals.
> It would be much better if total_rows, returned in the view, reflected the number of rows that would be returned had the count parameter not been supplied.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.