Skip to content

count() behavior not consistent with query result involving secondary index, OR secondary indexes broken somehow #160

Closed

Description

@srh

This behavior is reported:

<divad12>     query = r.table('table').order_by(r.desc('field1'), index=r.desc('field2'))
<divad12>     print query.count().run(r_conn())  # 4644
<divad12>     results = list(query.limit(5000).run(r_conn()))
<divad12>     print len(results)  # 1011

Without using the secondary index, we don't get weird behavior.

<divad12>     query = r.table('table').order_by(r.desc('field1'), r.desc('field2'))
<divad12>     print query.count().run(r_conn())  # 4644
<divad12>     results = list(query.limit(5000).run(r_conn()))
<divad12>     print len(results)  # 4644

And apparently use of r.desc affects the numbers!

<divad12>     query = r.table('table').order_by('field1', index='field2')
<divad12>     print query.count().run(r_conn())  # 4644
<divad12>     results = list(query.limit(5000).run(r_conn()))
<divad12>     print len(results)  # 4560

Removing the use of .limit(5000) reportedly does not affect the outcome.

Observed with rethinkdb 1.11.2 (CLANG 4.2 (clang-425.0.28)) (OS X).

Activity

  1. srh commented on Dec 23, 2013

    @srh
    ContributorAuthor

    Reported by @divad12.

  2. neumino commented on Dec 23, 2013

    @neumino
    Member

    Moving to the rethinkdb repo -- See rethinkdb/rethinkdb#1796

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions