TIMESERIES with LIMIT applies random sorting

NRQL queries that use TIMESERIES and LIMIT now sort results randomly. This seems to be new today. I had a query for some time that would make a timeseries of hourly transaction counts for the top 5 apps. This allows me to see which of our 25+ sites is serving more requests than others. Starting today, the five chosen seem to be random. That forces me to expand the LIMIT to include all apps too see the true picture, and it’s a lot harder to see what’s spiking due to all the lines.

Here’s the NRQL.

SELECT COUNT(*) AS 'Hits' FROM Transaction WHERE name NOT LIKE '%monitor.php' AND host NOT LIKE 'staging%' AND appName NOT LIKE 'SVR_%' AND appName NOT LIKE 'ENV_%' FACET appName SINCE 1 week ago TIMESERIES 1 hour LIMIT 100

I believe until today it was sorting on the COUNT(*) descending, perhaps by the last datapoint for each row. If this is not a bug that will be fixed, then I’d propose an ORDER BY clause that allows specifying by name or column order as can be done with SQL (e.g. ORDER BY appName or ORDER BY 1).

1 Like

Hi @leon.atkinson - The ability to ORDER BY has already been requested on the forum. Pop over and add your vote.

1 Like

@leon.atkinson I believe this behavior was part of something fishy we noticed yesterday. Looks like this was related to a bug that has been resolved. :thumbsup:

Please check to make sure that everything is working properly now! If not let us know and we can keep looking into it. Thanks for reaching out!

1 Like

Indeed, the behavior reverted to normal a few hours later. :grinning:

For the record, having an ORDER BY clause would be cool, but I’m happy as long as it defaults to returning largest values first.

1 Like

Awesome—I will make sure that goes “on the record” :wink:

I have passed on your use case for a ORDER BY clause. Thanks again!

Was the ORDER BY clause added as a possible? I would like to use this considering the inability to scroll within the data on the dashboard. Where is the link or thread to vote on this?

@SRE - Here’s the link for the ORDER BY feature request. Feature Idea: ORDER BY for NRQL

1 Like