Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have a query that gives the total number of rows to use in a pagination: select count(1) as total_rows from (subquery with some sum() and 2 inner joins) as as total_sums

1 - when I run only the subquery it takes 15s

2 - when I run the count against the subquery it takes 50 secs.

I am wondering to know if Vertica offers a better way to get the total of rows from an aggregation query.

share|improve this question
    
Sometimes a few line of code says more than a chapter in a book, or how it goes. Could you show the query? –  dezso Sep 12 '13 at 20:17
    
Besides posting the code, run "explain <query>;" and post the results. –  geoffrobinson Sep 13 '13 at 12:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.