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

JDBC Query will add "limit" at the end of "select * from tablename" #18

Open
titawork opened this issue Jul 1, 2019 · 4 comments
Open

Comments

@titawork
Copy link

titawork commented Jul 1, 2019

Why JDBC Query add "limit" at the end of "select * from tablename" ?
I think for tables with large of records, select without limit will spend long time, but add "LIMIT" for all query execute is not a good way.
But when I query with "select * from tablename offset 10 rows fetch next 10 rows only", it will run into error with the added "limit".

@cdessanti
Copy link

cdessanti commented Jul 1, 2019 via email

@titawork
Copy link
Author

titawork commented Jul 1, 2019

Thanks.
It is a good idea with using rowid pseudo column.
But I think a limit added is not good. It is not flexible.
Hope you can consider about delete this feature.

@cdessanti
Copy link

cdessanti commented Jul 1, 2019

We could add a connection parameter to make users able to disable the limit at their own risk; the limit is added to the statement at parse level, so we haven't any idea about the size of the table (assuming the query consists of just one table).
We could also enhance the rewrite of the statement to manage the offset clause.

Without the limit, the driver could allocate a considerable chunk of memory to fit the entire dataset client side.

About using the rowid, is more efficient than limit/offset clause, but you can use just on simple projection queries like select * from tab.

p.s. @randyzwitch this issue would be moved to jdbc driver repository

@randyzwitch randyzwitch transferred this issue from heavyai/heavydb Jul 7, 2019
@mlazatinph
Copy link

May we know the reason why the JDBC driver is overriding user input, i.e. when the user did not set any limit, why is the JDBC driver setting a limit?

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

3 participants