0

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.

  • 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
  • Post query and your explain output ! This will be a good start – Up_One May 8 '15 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.