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

🐛 Bug Report: Increase Pagination maximum offset from 5000 #5506

Open
2 tasks done
anhmeorv99 opened this issue May 5, 2023 · 5 comments
Open
2 tasks done

🐛 Bug Report: Increase Pagination maximum offset from 5000 #5506

anhmeorv99 opened this issue May 5, 2023 · 5 comments
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.

Comments

@anhmeorv99
Copy link

👟 Reproduction steps

Pagination: The maximum offset is 5000. But in some cases, i want use offset > 5000 . I want have default max offset = 5000 and i can config max offset from ENV.

👍 Expected behavior

Pagination: The maximum offset is 5000. But in some cases, i want use offset > 5000 . I want have default max offset = 5000 and i can config max offset from ENV.

👎 Actual Behavior

Pagination: The maximum offset is 5000. But in some cases, i want use offset > 5000 . I want have default max offset = 5000 and i can config max offset from ENV.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@anhmeorv99 anhmeorv99 added the bug Something isn't working label May 5, 2023
deepam-kapur added a commit to deepam-kapur/appwrite that referenced this issue May 5, 2023
…0 for list documents pagination

appwrite#5006 fixed with adding APP_LIMIT_DOCUMENT_COUNT new variable added in init.php with value as 1000000
@deepam-kapur
Copy link

Raised PR - #5508
On branch - deepam-kapur:fix-5506-pr-for-limit-document-count

Please review it! & lemme know if any change is required!

@joeyouss joeyouss changed the title 🐛 Bug Report: 🐛 Bug Report: Increase Pagination maximum offset from 5000 May 9, 2023
@joeyouss
Copy link

joeyouss commented May 9, 2023

Hi, there is a reason for this.
The maximum offset is 5000, since the request gets slower as the number of records increases because the database has to read up to the offset number of rows to know where it should start selecting data. Also when there is data added in high frequency - the individual pages might skip results.

@joeyouss joeyouss self-assigned this May 9, 2023
@stnguyen90 stnguyen90 added the product / databases Fixes and upgrades for the Appwrite Database. label Jun 23, 2023
@byawitz
Copy link
Member

byawitz commented Jul 17, 2023

In case you have a need to remove this limit in a self-hosted Appwrite, you can do so by overriding init.php file, like so:

  1. Edit your docker-compose.yml file, and bind the file to any container that uses the appwrite/appwrite image.
   appwrite:
    image: appwrite/appwrite:1.3.7
    container_name: appwrite
    <<: *x-logging
    restart: unless-stopped
    networks:
      - appwrite
    labels:
      ...
    volumes:
      ...
      - /root/customized/init.php:/usr/src/code/src/app/init.php
    depends_on:
      ...
    environment:
      ...
  1. Create a file in the location /root/customized and name it init.php. inside that file paste all the content of the original init.php file
  2. Edit this line. set it to whatever value you like.
const APP_LIMIT_COUNT = 5000000;

Then you're set to go.

@byawitz
Copy link
Member

byawitz commented Jul 17, 2023

Also, this ☝️PR can give any self-hoster of Appwrite the option to change this option in the .env file.

@tripolskypetr
Copy link

That will be quite usefull for my project. I need to fetch all documents in appwrite function once a day but that limit force me to make multiple requests for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / databases Fixes and upgrades for the Appwrite Database.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants