-
Notifications
You must be signed in to change notification settings - Fork 18
docs(ASOF JOIN): Clarify timestamp control and precedence #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
it was confusing before
🚀 Build success! Latest successful preview: https://preview-197--questdb-documentation.netlify.app/docs/ Commit SHA: 62d4145
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
Suggest:
Ditching Title Case with the Capitals
- if we had a style guide, it'd say useConversational case in titles
.- I believe the queries are demo-able, and can be tagged such
- A couple minor suggestions re: title length and header structure
@@ -327,30 +327,86 @@ Result: | |||
|
|||
</div> | |||
|
|||
### Timestamp considerations | |||
### How ASOF JOIN Uses Timestamps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### How ASOF JOIN Uses Timestamps | |
### How ASOF JOIN uses timestamps |
|
||
:::caution | ||
#### The Default Behavior: Implicit Timestamp Propagation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This title is slightly long.
Consider:
#### Default behaviour
As a default, QuestDB appies implicit timestamp propogation. This means that by default, an `ASOF JOIN` will...
|
||
```questdb-sql | ||
```questdb-sql title="ASOF JOIN with designated timestamp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Demo-able query?
``` | ||
|
||
#### The Standard Override Method: Using ORDER BY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### The Standard Override Method: Using ORDER BY | |
#### Using ORDER BY |
|
||
Example: Joining on `ingestion_time` instead of the default `trade_ts` | ||
|
||
```questdb-sql title="ASOF JOIN with custom timestamp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also demo-able?
ASOF JOIN quotes ON (symbol); | ||
``` | ||
|
||
#### Using the timestamp() Syntax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#### Using the timestamp() Syntax | |
#### Using the timestamp() syntax |
Rework the
ASOF JOIN
timestamp documentation to address the common misuse of thetimestamp(ts)
syntax.The guide now clarifies that the designated timestamp is inherited by default. The standard method for joining on a different column is to use an
ORDER BY
clause in a subquery, which implicitly sets a new timestamp for the join.The
timestamp(ts)
syntax is now correctly framed as an expert-level performance hint, used only to assert a pre-sorted order on data that lacks a designated timestamp.