Help with LIMIT performance?

Moderator: NorbertKrupa

Post Reply
User avatar
Posts: 93
Joined: Wed Jan 25, 2012 4:53 am

Help with LIMIT performance?

Post by usli06 » Wed Aug 05, 2015 6:16 pm


Is there a any way to enhance the performance of queries using the LIMIT option? It seems like if I am querying large tables, even adding a LIMIT 1 still takes a long time...

Thanks guys!

Posts: 527
Joined: Tue Oct 22, 2013 9:36 pm
Location: Chicago, IL

Re: Help with LIMIT performance?

Post by NorbertKrupa » Wed Aug 05, 2015 8:41 pm

What does your query look like?

Also take a look at Optimizing LIMIT Queries with ROW_NUMBER Predicates.
Checkout for more Vertica resources.

Posts: 301
Joined: Tue Aug 07, 2012 2:15 am

Re: Help with LIMIT performance?

Post by scutter » Wed Aug 05, 2015 8:51 pm

It’s going to depend greatly on what sort of query you are executing. Each node will limit the data that it sends back to the initiator to a single row as quickly as it can. But if the query needs to do lots of work before it can apply the LIMIT 1 then you need to wait. For example a large GROUP BY HASH that is executing prior to the LIMIT 1 will need to finish executing before the LIMIT 1 can be applied.

How long is the “long time” in your case?

Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

Post Reply

Return to “Vertica Performance Tuning”