这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@slowr
Copy link
Contributor

@slowr slowr commented Nov 12, 2018

Description

Auto-generated queries when there is an order function they include NULLS FIRST or NULLS LAST.
Descending ordering auto-generated queries include NULLS LAST instead of postgres default; NULLS FIRST
This tends to mess-up indexing tables as mentioned in #1008 and #657

What component does this PR affect?

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Requires changes from other components? If yes, please mark the components:

  • Server
  • Console
  • CLI
  • Docs
  • Community Content
  • Build System

Related Issue

#1008
#657

Solution and Design

A new enum is added to avoid NULLS ordering (FIRST, LAST) in the auto-generated queries. Decided to introduce new enum and not change the default implementation to keep backwards compatibility.
Change the default NULLs ordering for desc to be NULLS FIRST so it follows postgres specification.

Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Docs update
  • Community content

Checklist:

  • I have read the contributing guide and my code conforms to the guidelines.
  • This change requires a change in the documentation.
  • I have updated the documentation accordingly.
  • I have added required tests.

@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Hey @slowr, thanks for your PR!

One of my human friends will review this PR and get back to you as soon as possible. 🕐

Stay awesome! 😎

@slowr slowr changed the title adds new enum to remove nulls ordering in the SQL query, fix #1008 add new enum to remove nulls ordering in the SQL query, fix #1008 Nov 12, 2018
@shahidhk shahidhk requested a review from 0x777 November 12, 2018 05:54
@shahidhk shahidhk added the c/server Related to server label Nov 12, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-1009.herokuapp.com

@0x777
Copy link
Member

0x777 commented Nov 21, 2018

@slowr We decided to change the default behavior of desc to use nulls first instead of the current nulls last. The enums would therefore be:

asc
asc_nulls_last # same as asc
asc_nulls_first
desc
desc_nulls_first # same as desc
desc_nulls_last

Will you be willing to make these changes? If so, you don't need to add another value called NNull in the SQL AST. You can just map desc to NFirst and asc to NLast.

@slowr
Copy link
Contributor Author

slowr commented Nov 21, 2018

@0x777 Should I make the change to the files on this PR and change descriptions etc?

@slowr slowr changed the title add new enum to remove nulls ordering in the SQL query, fix #1008 change descending ordering to nulls first, fix #1008 #657 Nov 21, 2018
@slowr slowr changed the title change descending ordering to nulls first, fix #1008 #657 change descending ordering to nulls first, fix #1008 Nov 21, 2018
@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-1009.herokuapp.com

@hasura-bot
Copy link
Contributor

Review app available at: https://hge-ci-pull-1009.herokuapp.com

@shahidhk shahidhk changed the title change descending ordering to nulls first, fix #1008 change descending ordering to nulls first (fix #1008) Nov 22, 2018
@shahidhk shahidhk merged commit ef6e53a into hasura:master Nov 22, 2018
@hasura-bot
Copy link
Contributor

Beep boop! 🤖

Whoa! 🎉 🎉 💃

GIF

Awesome work @slowr! 💪 🏆 All of us at Hasura ❤️ what you did.

Thanks again 🤗

@hasura-bot
Copy link
Contributor

Review app https://hge-ci-pull-1009.herokuapp.com is deleted

hasura-bot pushed a commit that referenced this pull request Aug 28, 2024
<!-- The PR description should answer 2 important questions: -->

### What

Expose operation type in query and explain endpoints.

V3_GIT_ORIGIN_REV_ID: 852276fc04b3173a9364e593c33d1ceb6bd88064
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/server Related to server

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants