Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

MDB_INTEGERKEY and endianness #105

Copy link
Copy link
@kogupta

Description

@kogupta
Issue body actions

I am facing an issue while using range search using KeyRange.

In lmdb, the following is stored:

key: event timestamp in millis
value: event payload

What I want to do:

  • count query by for a given time range (how many events between 1000 hrs to 1010 hrs)
  • fetch all the events for a given time range

Issue:

  • if counts are queried using KeyRange.all(), correct count is returned.
  • but, if queried using specific range, it does not return current count:
    • KeyRange.closed(min, max) returns 0

Observations:

  • strangely, if queried using KeyRange.closed(min, max * numberOfKeys), it returns correct result.
  • if the keys are dense, then things work as expected
    • say,
    long start = toMillis(LocalDateTime.of(2018, Month.JANUARY, 1, 0, 0));
    for(int i = 0; i < numberOfKeys; i++) {
      dbi.put(bb(start + i), bb(i));
    }
    
    • in this scenario, KeyRange.closed() etc. work as expected.

My question is :
am I using the correct APIs for my usecase? is it a configuration issue?


Note:

  • Java version
    $ java -version
    java version "1.8.0_181"
    Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
    
  • Windows 10 dev environment

A reproducible test case: gist

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQueries on usage of the library, architectural patterns and alikeQueries on usage of the library, architectural patterns and alike

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.