Skip to content
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

Add created_at query plan #26

Closed
Tracked by #7 ...
jb55 opened this issue Mar 12, 2024 · 0 comments
Closed
Tracked by #7 ...

Add created_at query plan #26

jb55 opened this issue Mar 12, 2024 · 0 comments
Assignees

Comments

@jb55
Copy link
Contributor

jb55 commented Mar 12, 2024

For timeline queries and query fallbacks, the simplest possible query plan is the created_at scan. This works well for timelines in our case, because nostrdb is not typically used as a global database and should contain notes intended for us anyways. This allows us to simplify timeline queries into a linear scan. Since most of our indices are ordered by created_at, this linear scan is pretty efficient for looking for recent notes.

@jb55 jb55 self-assigned this Mar 12, 2024
@jb55 jb55 closed this as completed in 2bdde76 Mar 13, 2024
jb55 added a commit to damus-io/damus that referenced this issue Apr 4, 2024
This introduces the basic created_at query plan. We scan the created_at
+ id index in descending order looking for items that match a filter.
This is a very general query plan, but might not be very efficient for
anything other than local timelines.

Changelog-Added: Add general created_at query plan for timelines
Closes: damus-io/nostrdb#26
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 added a commit to damus-io/damus that referenced this issue Apr 4, 2024
This introduces the basic created_at query plan. We scan the created_at
+ id index in descending order looking for items that match a filter.
This is a very general query plan, but might not be very efficient for
anything other than local timelines.

Changelog-Added: Add general created_at query plan for timelines
Closes: damus-io/nostrdb#26
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 added a commit to damus-io/damus that referenced this issue Apr 25, 2024
This introduces the basic created_at query plan. We scan the created_at
+ id index in descending order looking for items that match a filter.
This is a very general query plan, but might not be very efficient for
anything other than local timelines.

Changelog-Added: Add general created_at query plan for timelines
Closes: damus-io/nostrdb#26
Signed-off-by: William Casarin <jb55@jb55.com>
jb55 added a commit to damus-io/damus that referenced this issue Apr 25, 2024
This introduces the basic created_at query plan. We scan the created_at
+ id index in descending order looking for items that match a filter.
This is a very general query plan, but might not be very efficient for
anything other than local timelines.

Changelog-Added: Add general created_at query plan for timelines
Closes: damus-io/nostrdb#26
Signed-off-by: William Casarin <jb55@jb55.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant