Skip to content

Conversation

@yoshiokatsuneo
Copy link
Contributor

@yoshiokatsuneo yoshiokatsuneo commented Feb 22, 2025

What type of PR is this?

  • Feature

Description

Before this PR, query list ordering does not have "NULLS LAST" option.

So, when I sort query list by "Last Executed At" in descendant order to see the recent active queries, I got bunch of queries that is not executed at all and "executed_at" is null in the beginning of the list.

This happens because PostgreSQL handles NULL as the "largest value" for ordering.

I think the behavior does not make sense.

This PR fix the issue by adding "NULLS LAST" options for ordering so that the most recent query comes first, instead of query that was never run comes first.

How is this tested?

  • Manually

Before this PR:
image

After this PR:
image

@yoshiokatsuneo yoshiokatsuneo changed the title add NULLS LAST option for Query order Add NULLS LAST option for Query ordering Feb 22, 2025
@yoshiokatsuneo yoshiokatsuneo changed the title Add NULLS LAST option for Query ordering Add NULLS LAST option for query list ordering Feb 22, 2025
Copy link
Member

@gaecoli gaecoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gaecoli gaecoli merged commit 5df5ca8 into getredash:master Feb 25, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants