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

Ordering of result of wg_find_record_int function #42

Open
rohanbabu opened this issue Dec 20, 2018 · 1 comment
Open

Ordering of result of wg_find_record_int function #42

rohanbabu opened this issue Dec 20, 2018 · 1 comment

Comments

@rohanbabu
Copy link

The documentation has it that this function will return a pointer to the first matching record.

  1. Does it mean that the first matching record is the one that was created first?
  2. Do subsequent calls to the function to get all matching records return records in the order in which they were created?
  3. If not, are there ways to sort the results of a query according to the order in which they were created?
@priitj
Copy link
Owner

priitj commented Dec 20, 2018

  1. No.
  2. No.
  3. If you store the creation timestamp, create an index on it and query a range using the timestamp, then the results will be sorted by creation time.

In general, there is no sorting support built in whitedb. However, if you rarely delete or never delete records, in most cases they will be fetched in order of creation. So this might still be useful if you sort them later, the sort will complete faster if they are already almost sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants