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

Remove useless columns from search results #49

Closed
eugef opened this issue Feb 27, 2014 · 1 comment
Closed

Remove useless columns from search results #49

eugef opened this issue Feb 27, 2014 · 1 comment

Comments

@eugef
Copy link
Contributor

eugef commented Feb 27, 2014

@sasanrose , i propose to remove columns "idle time" and "ref count" from search results as they are useless.

According to http://redis.io/commands/OBJECT

OBJECT IDLETIME returns the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).

In our case idle time will always be 0, because those key was just returned (read) by KEYS command.

OBJECT REFCOUNT returns the number of references of the value associated with the specified key. This command is mainly useful for debugging.

When accessing the object, the refcount is increased so that you cannot try to delete an object that is being accessed. By default, the refcount is 1 because one key refers to one value. It will quickly jump up to 2 and back down to 1 again during a GET, whilst the object is read. This means that if you issue a DEL on the object during the GET, you bring the refcount down to 1 instead of 0. Then, when the GET completes, the refcount decrements again and hits 0, and is successfully deleted.

The OBJECT REFCOUNT command is simply there to debug reference counting, to make sure refcounts are incremented and decremented properly across all paths of execution.

Again, ref count will be equal to 1 for all the keys in search result set.

As for me these two columns could be removed as they are useless. This also will save us 2 request to Redis per key.

If you agree with proposed changes i will implement them.

@blitzmann
Copy link
Contributor

I agree, I don't see a reason for these.

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