Navigation Menu

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

TeraData dedicated pagination support #556

Closed
timowest opened this issue Nov 15, 2013 · 9 comments
Closed

TeraData dedicated pagination support #556

timowest opened this issue Nov 15, 2013 · 9 comments
Milestone

Comments

@timowest
Copy link
Member

Efficient TeraData mechanism for result pagination; currently see three options2
a. Run the query again with a select count(*).
b. Cursor to end of result set and skip any between rows [rs.last();int nRowCount = rs.getRow();]
c. Add an Ordered Analytic to the query to have it include the count.

@timowest
Copy link
Member Author

Concerning c. count(*) over() could be used as an additional projection element to get the count out.

@lukaseder
Copy link

Learning from the best? :-)

@timowest
Copy link
Member Author

I knew this would provoke some comment from you. ;)
Yes, I will try to unify the pagination logic in Querydsl SQL.

@lukaseder
Copy link

Hmm, I have to work on my trolling predictability ;-)
Good luck! That's probably the most challenging part of SQL transformation...

@timowest
Copy link
Member Author

@lukaseder Does jOOQ also have single query support for paged data and total count? count(*) over() seems to work for databases that support this function. For other cases Querydsl does two queries.

Good luck! That's probably the most challenging part of SQL transformation...

Yes, it's quite a pita.

@lukaseder
Copy link

Does jOOQ also have single query support for paged data and total count? count(*) over() seems to work for databases that support this function.

COUNT(*) OVER() is certainly the best way for those 5-6 databases that support window functions. jOOQ doesn't have any such flags to auto-calculate these things...

@timowest
Copy link
Member Author

Thanks for the confirmation.

@timowest
Copy link
Member Author

Released in 3.3.0

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