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

Performance improvement with large table scans #141

Open
5 tasks
abose opened this issue Feb 18, 2023 · 0 comments
Open
5 tasks

Performance improvement with large table scans #141

abose opened this issue Feb 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@abose
Copy link
Member

abose commented Feb 18, 2023

Currently, the scan APIs like getFromNonIndex and query API has significant performance issues when working with large tables of >1M rows and with paging. Observations:

measurements of pagination performance with scan

Number of rows in table

Row Count Size
1,194,515 2.8GB

image

measurement with an integer column

SELECT * FROM phcode_extensions_dev.extensionDetails order by idx limit 100000,100;
35016:19:52SELECT * FROM phcode_extensions_dev.extensionDetails order by idx limit 100000,100100 row(s) returned0.687 sec / 0.079 sec
35116:19:54SELECT * FROM phcode_extensions_dev.extensionDetails order by idx limit 100000,100100 row(s) returned0.719 sec / 0.062 sec
35216:26:44SELECT * FROM phcode_extensions_dev.extensionDetails order by idx limit 100000,100100 row(s) returned0.703 sec / 0.078 sec
35316:26:50SELECT * FROM phcode_extensions_dev.extensionDetails order by idx limit 100000,100100 row(s) returned0.703 sec / 0.078 sec

measurement with documentID

SELECT * FROM phcode_extensions_dev.extensionDetails order by documentID limit 100000,100;
35416:28:48SELECT * FROM phcode_extensions_dev.extensionDetails order by documentID limit 100000,100100 row(s) returned0.344 sec / 0.078 sec
35516:28:49SELECT * FROM phcode_extensions_dev.extensionDetails order by documentID limit 100000,100100 row(s) returned0.344 sec / 0.078 sec
35616:28:51SELECT * FROM phcode_extensions_dev.extensionDetails order by documentID limit 100000,100100 row(s) returned0.329 sec / 0.078 sec
35716:28:53SELECT * FROM phcode_extensions_dev.extensionDetails order by documentID limit 100000,100100 row(s) returned0.344 sec / 0.078 sec

measurement with using no order-by clause

38116:40:02SELECT * FROM phcode_extensions_dev.extensionDetails limit 100000,100100 row(s) returned0.343 sec / 0.266 sec
38216:40:04SELECT * FROM phcode_extensions_dev.extensionDetails limit 100000,100100 row(s) returned0.328 sec / 0.187 sec
38316:40:06SELECT * FROM phcode_extensions_dev.extensionDetails limit 100000,100100 row(s) returned0.344 sec / 0.141 sec
38416:40:12SELECT * FROM phcode_extensions_dev.extensionDetails limit 100000,100100 row(s) returned0.328 sec / 0.109 sec
  • investigate why the integer based index performs worse than a string based index, also investigate if there is a faster way to do this.
  • not using order by seems to offer the highest performance for duration, but worse fetch penalty in the tests
@abose abose added the enhancement New feature or request label Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant