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
Daily Notes not showing up in Chronological Order #235
Comments
@tangjeff0 Can you assign this to me (again) 😅 ? |
You can't assign yourself? That's why I added you all to Also, did you get to read my comment about the "Jump to Timeline" on the original issue? |
I wasn't able to assign myself. Not sure why. Unfortunately I didn't get to read it. Do you remember what you wrote? |
Using ascending dates to debug was a good move. I feel that You should know that I would eventually like to have a "Jump to Timeline" feature, mentioned in #66. This would allow a user to jump to any date in the past and scroll up or down to go to neighboring dates. Right now in Roam, you can only scroll down starting from today. Basically, if you are on a date page, you would see a little button like Also, the vector should be cleared when you navigate away from daily pages. Don't think that's the problem, just something to keep in mind. |
Awesome! Thanks Jeff. |
Documenting some things from convo with @itsrainingmani:
;; small maps stay as
(def mapA {:a 1 :b 2})
mapA ; => {:a 1, :b 2}
;; somewhere around 9 elements leads to rearranging
(def mapB {:a 1 :b 2 :c 3 :d 4 :e 5 :f 6 :g 7 :h 8 :i 9})
mapB ; => {:e 5, :g 7, :c 3, :h 8, :b 2, :d 4, :f 6, :i 9, :a 1} (see this clojuredocs.org link for reference) My initial thought was to attempt to override this behavior somehow (naive thinking), but @itsrainingmani informed me that
See this excerpt from a relevant post about Datascript internals from Tonsky's blog. We are looking into B+ tree structures starting with the wiki. Will update as we make more progress. |
I think the issue here is in the order that DataScript returns the results of a query rather than an issue with The number 8 is interesting because the insertion order seems to be "preserved" until a 9th element is added which then changes the order. However, the DataScript indexes (EAVT, AVET, AEVT) don't seem to change. It seems like there is no order guarantee for DataScript queries as far as I can see. Now why does DataScript preserve order for some number of items? My hypothesis is that this is a function of the B+ Tree structure. After a certain number of elements, (in this case 8), the tree rebalances it's buckets. Solutions -
|
Great research gang.
We should look into places wherever we make larger queries such as Athena and linked references and see how we want to sort results if we want to at all. See #20 (comment) Regarding your solutions, even pulling all pages without sort is expensive. See Roam's. @jelmerderonde also has paginated results in datascript devtools. I don't think having limits in |
Went back ~20 notes, everything is correct and can't reproduce it. |
Problem
After creating a certain number of Daily Notes, they no longer show up in chronological order.
Expected Behavior
Daily Notes should always be in chronological order irrespective of how many daily notes have been created
To Reproduce
Screenshots
https://www.loom.com/share/7fa0eeb7148d4da68e354d2e254e002b
The text was updated successfully, but these errors were encountered: