home shape

Enhanced AQL in ArangoDB 2.4: Boost Query Performance

While on a retreat in Belgium, we found some spare time to work on improvements for AQL. These will be shipped with ArangoDB version 2.4, and are already available in the devel version for testing from now on.

Here’s a short overview of the improvements:

Collect with count

A common use case in query languages is to count the number of documents returned by a query. The AQL solution for this has been to use the LENGTH function and a subquery:

RETURN LENGTH((
  FOR doc IN collection 
    FILTER doc.someAttribute == someValue
    RETURN doc
  ))

This is quite long and probably unintuitive for people which have used SQL for years.

We therefore now allow using the following alternative version:

Read more on Jan’s Blog

Jan Steemann

Jan Steemann

After more than 30 years of playing around with 8 bit computers, assembler and scripting languages, Jan decided to move on to work in database engineering. Jan is now a senior C/C++ developer with the ArangoDB core team, being there from version 0.1. He is mostly working on performance optimization, storage engines and the querying functionality. He also wrote most of AQL (ArangoDB’s query language).

2 Comments

  1. Antonis Karagiannis on December 15, 2014 at 2:12 pm

    Nice, this was a “missing” feature.
    Good to see that ArangoDB is getting better and better, week by week!

  2. CoDEmanX on December 19, 2014 at 1:56 am

    Is “WITH COUNT INTO …” or “INTO … COUNT” the final syntax?

Leave a Comment





Get the latest tutorials, blog posts and news: