floere/picky — Issue #37: Add dynamic or static hint to index definitions
Author: floere
Created: 2011-11-02 03:06:16+00:00
State: open
Labels: Server, Thinkies

When the index is static, it is advisable to use symbols internally.

However, when also removing entries from the index using `index.remove(id)`, it is better to use Strings, as Symbols never get freed.

Consider adding a hint to the index definition as follows:

```ruby
Picky::Index.new(:dynamic) do
static
end
```

or

```ruby
Picky::Index.new(:dynamic) do
unchanging
end
```

or

```ruby
Picky::Index.new(:dynamic) do
static true
end
```

Also think about what the default should be. I tend towards dynamic indexes. And let the user add a helpful hint to optimize in case it's static.

It's theoretically impossible to determine at runtime what to do, so we need the user input.