-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
area/performancePerformance related issues.Performance related issues.area/querylang/paginationRelated to pagination: first, offset, etcRelated to pagination: first, offset, etcexp/expertDeeply technical issue not recommended to beginners.Deeply technical issue not recommended to beginners.kind/enhancementSomething could be better.Something could be better.popularpriority/P1Serious issue that requires eventual attention (can wait a bit)Serious issue that requires eventual attention (can wait a bit)status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.
Description
Since after-based pagination doesn't work (see #3472 and #2744 and the forum) I had to fall back to offset-based pagination instead, which I expected to be slow (since offsets usually never use the indexes), yet I'm not sure whether it's generally expected to be that slow.
-
What version of Dgraph are you using?
-
Have you tried reproducing the issue with latest release?
-
What is the hardware spec (RAM, OS)?
- OS: Windows 10 (Linux in docker)
- RAM: 64 GB
-
Steps to reproduce the issue (command/config used to run Dgraph).
- Setup testing environment with
docker-composeusing the latest Dgraph images - Setup the schema:
Post.id: string @index(hash) . Post.creation: dateTime . Post.title: string . Post.contents: string .- Fill the database with lots of data using this template:
{ set { _:post1 <Post.id> "00000000000000000000000000000006" . _:post1 <Post.title> "post 1" . _:post1 <Post.contents> "post 1 contents" . _:post1 <Post.creation> "2019-05-28T10:00:00+00:00" . } }(I used a dataset of 83.719 nodes)
- Read the last 10 items of, say, 100k:
{ all( func: has(Post.id), orderasc: Post.id, first: 10, offset: 99990 ) { uid Post.id Post.title Post.contents Post.creation } } - Setup testing environment with
-
Expected behaviour and actual result.
- expected: as I already said, I expected
offsetto be slow, but since I had no other option left for pagination I could expect it to optimize this query using thehashindex, otherwise pagination is pretty much impossible to get fast. - actual: it takes almost 2.5 - 5 seconds!
- expected: as I already said, I expected
dihmeetree, liveforeverx, ysmu, morgothulhu, erhlee-bird and 1 more
Metadata
Metadata
Assignees
Labels
area/performancePerformance related issues.Performance related issues.area/querylang/paginationRelated to pagination: first, offset, etcRelated to pagination: first, offset, etcexp/expertDeeply technical issue not recommended to beginners.Deeply technical issue not recommended to beginners.kind/enhancementSomething could be better.Something could be better.popularpriority/P1Serious issue that requires eventual attention (can wait a bit)Serious issue that requires eventual attention (can wait a bit)status/acceptedWe accept to investigate/work on it.We accept to investigate/work on it.