|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
hashmap or hashtable ? |
« View previous topic :: View next topic » |
Author |
Message
|
Maximreality |
Posted: Wed Nov 22, 2006 4:55 am Post subject: hashmap or hashtable ? |
|
|
 Acolyte
Joined: 04 Jun 2004 Posts: 65 Location: Copenhagen
|
Do we have the concept of a hashmap or hashtable in ESQL?
I can only find advanced datatypes that is based on tree structures (like row)
/Rasmus |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 22, 2006 5:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
A tree is all you've got.
You can treat a ROW variable as a Hash, though, using {}.
DECLARE myHash ROW;
Set myLookup = 'abcd';
set myHash.{myLookup} = '123';
set newValue = myHash.{myLookup};
It may not perform as well as you'd like it to, particularly on large trees. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jbanoop |
Posted: Wed Nov 22, 2006 5:06 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
in my experience ..no .. though you can do selects on the tree structures you have , thus simulating a key-value behaviour.
Anoop |
|
Back to top |
|
 |
Maximreality |
Posted: Wed Nov 22, 2006 5:24 am Post subject: |
|
|
 Acolyte
Joined: 04 Jun 2004 Posts: 65 Location: Copenhagen
|
jefflowrey wrote: |
A tree is all you've got.
You can treat a ROW variable as a Hash, though, using {}.
DECLARE myHash ROW;
Set myLookup = 'abcd';
set myHash.{myLookup} = '123';
set newValue = myHash.{myLookup};
It may not perform as well as you'd like it to, particularly on large trees. |
....the problem here is CPU cost (we are running on z/OS)
We have several interfaces using lookup tables in a DB2 and i am trying to cache these lookup tables on the broker with the SHARED functionality of version 6.
I am currently using the ROW for this experiment, but was just wondering if we had something better/faster/cheaper.
The lookup tables varies from 20 -> 500.000 entries, but most of them have around 500-3000 entries.
/Rasmus |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 22, 2006 5:29 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
If you're looking to reduce CPU cost for Broker on z/OS... you should be looking to use JavaCompute nodes and offload work to the ZAAP.
Otherwise, yes - you're on the right track using Row variables to cache database lookups. The sample in the Samples gallery should perform fairly well - and you can use it to run benchmarks as well. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|