Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Object Count in PostgreSQL #6311

Closed
ssafayet opened this issue Jan 2, 2020 · 2 comments
Closed

Wrong Object Count in PostgreSQL #6311

ssafayet opened this issue Jan 2, 2020 · 2 comments

Comments

@ssafayet
Copy link
Contributor

ssafayet commented Jan 2, 2020

Issue Description

I am currently using Parse Server with PostgreSQL as the database. Problem is, for some classes count is always returning 0 even if there are objects.

Steps to reproduce

  1. Create a class.
  2. Add some row using parse dashboard (2.0.5)
  3. See that the count is not getting updated in the Data browser - stays 0.
  4. Also if I submit a count query via rest or JS SDK, it returns 0.
    Ref: https://docs.parseplatform.org/js/guide/#counting-objects

Here is a sample screenshot of the mismatched User count.
https://imgur.com/a/J3Q9N3p

Expected Results

Provide the actual count of the objects in a Class.

Actual Outcome

Returns 0

Environment Setup

  • Server

    • parse-server version: 3.9.0
    • Operating System: Ubuntu
    • Hardware: Core i3 3rd Gen, 16 GB ram
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [localhost]
  • Database

    • MongoDB version: [Not applicable]
    • Postgres Version: 12.1
    • Storage engine: [Not applicable]
    • Hardware: Same as previous
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): localhost

Logs/Trace

@dplewis
Copy link
Member

dplewis commented Jan 3, 2020

There is a known issue with Postgres called slow counting. Counting can be an expensive operation so we provide an estimate count to allow for scalability.

See the conversation here.

@ssafayet
Copy link
Contributor Author

ssafayet commented Jan 4, 2020

Noted. Closing this issue. Thanks!

@ssafayet ssafayet closed this as completed Jan 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants