Forum Discussion

dragonflymr's avatar
dragonflymr
Icon for Cirrostratus rankCirrostratus
Nov 23, 2015

Table wildcard lookup

Hi,

 

Let's say I am not using subtable, key value is based on variable not know in advance - like value of application cookie. What is simplest way to find all keys - start key name with some constant string like session:session cookie value?

 

If so is that possible to find all keys starting with string before ":" like wildcard lookup?

 

Piotr

 

5 Replies

  • Hi Piotr,

     

    unfortuately there is no way to query every single table key.

     

    If you need to crawl through a specific collection of keys then you have to store these keys into a subtable. By using subtables you can use the [table keys -subtable TABLE_NAME] command in combination with commands that are able to parse/evaluate the retrieved list of containing key names.

     

    Cheers, Kai

     

  • Hi,

     

    Thanks. Subtable is of course an option, only issue is that I saw somwhere that it's not performance vise to use subtables if not necessary - something that subtable is always placed in memory of one TMM - or maybe I am wrong here - so with big subtables memory usage can be sub optimal?

     

    Piotr

     

  • Hi Piotr,

     

    this is right - avoid using subtables unless its realy necessary.

     

    To further increase the subtable performance you could distribute the individual keys across multiple (but still well known) subtables using an performant algorythm of you choice (e.g. first letter, some CRC, etc.), so that the individual keys are still queryable but distributed on different cores.

     

    What are you exactly trying to achive?

     

    Cheers, Kai

     

  • Thanks for idea - will investigate. I am using tables for some HTTP session management and rate limiting.

     

    Piotr