questdb / questdb/questdb

Add DAY_START and DAY_END as valid RANGE boundaries for window joins

Open
#6,678 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

New feature
Dominant language
Java
Stars
17.3k
Forks
1.7k
Avg merge
5d 10h
Merged PRs (30d)
28

Description

Is your feature request related to a problem?

I had a conversation with Andrei about this and we are not super sure it would be useful, as we want more feedback from users, but agreed it would be interesting to add here to track interest.

Would it make sense to add, for intraday calculations, DAY_START and DAY_END as values to be used instead of PRECEDING or FOLLOWING?
SELECT a.*, avg(b.price) from a window join b ON(symbol) RANGE BETWEEN DAY_START AND 0 seconds FOLLOWING
That would give me a moving average.
Not 100% if this would be useful as I guess we could have the same doing the AVG OVER in table B on a CTE and then ASOF JOIN.

For example, not sure we can do a rolling standard deviation now. We can with a trick calculating square roots with window functions, but not straight forward. A window join from day start could calculate it

Describe the solution you'd like.

No response

Describe alternatives you've considered.

No response

Full Name:

javier

Affiliation:

questdb

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the window-join RANGE boundary parsing and execution code, then review how PRECEDING and FOLLOWING are represented. Use the DAY_START and DAY_END example to define the intended semantics, add coverage for intraday moving-window calculations, and verify the resulting SQL behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.