Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

#first performance problem #18

Open
gucki opened this Issue · 1 comment

2 participants

@gucki

Using a simple Person.first seems to load all people in the database and then only use the first record.

Output from redis monitor when doing a Person.first with 3 records in the db:

+1311105369.469164 "smembers" "person:id:all"
+1311105369.469654 "hgetall" "person:1"
+1311105369.470109 "hgetall" "person:2"
+1311105369.470555 "hgetall" "person:3"

@whoahbot
Owner

There are many non-indexed uses of dm-redis that will incur a performance penalty based on the number of records, since the way that the adapter is currently written will fall-through to finding each record in the set of all records when a query has no other more optimal path to locating that record.

In the case of #first, I agree, there should be a more optimal path that the adapter uses to locate the first record, since loading each record is wasteful.

I'm not sure I'll have a chance to work on this in the near future, did you have a suggestion for improving the performance of #first?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.