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

@timowest timowest commented Nov 15, 2013

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

@timowest timowest commented Dec 16, 2013

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

@lukaseder
Copy link

@lukaseder lukaseder commented Dec 17, 2013

Learning from the best? :-)

@timowest
Copy link
Member Author

@timowest timowest commented Dec 17, 2013

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

@lukaseder
Copy link

@lukaseder lukaseder commented Dec 17, 2013

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

@timowest timowest commented Dec 17, 2013

@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

@lukaseder lukaseder commented Dec 17, 2013

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

@timowest timowest commented Dec 17, 2013

Thanks for the confirmation.

@timowest
Copy link
Member Author

@timowest timowest commented Dec 22, 2013

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants