Hi, I guess you need to maps: one for the data, with the long key (Map<Long, Data>), and another one for the hash and the long key (Map<Hash, Long>). The second map is a secondary index.
But I don't recommend indexing a hash. If you have many rows, this will get very slow, and with the MVStore, it will need a lot of disk space. You can try, but I would avoid that if possible. This is not just a problem with the MVStore, but also with other databases (MySQL, PostgreSQL, MongoDB,... basically all databases). Regards, Thomas On Thu, Dec 10, 2015 at 3:28 AM, Adam McMahon <[email protected] <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: > I don't know exactly how this maps to H2's MV. but can't you just have > only Strings as keys. When you need a Long as a key, just take the string > value of the Long. > > -Adam > > > On Wednesday, December 9, 2015 at 4:31:50 PM UTC-5, Jan Juno wrote: >> >> Hi >> >> Each entry has 2 types of keys Long and a Hash256(String). >> You want to lookup for a value using Long or hash string. >> >> >> On Monday, December 7, 2015 at 9:33:13 AM UTC+1, Thomas Mueller wrote: >>> >>> Hi, >>> >>> Could you give an example please? Your description is not clear to me. >>> >>> > but uses multiple (differently-typed) keys >>> >>> Each entry has multiple keys, or different entries have different keys? >>> Maybe you need multiple maps? >>> >>> Regards, >>> Thomas >>> >>> >>> On Sat, Dec 5, 2015 at 5:44 PM, Jan Juno <[email protected]> wrote: >>> >>>> I need a data structure which behaves like a Map, but uses multiple >>>> (differently-typed) keys to access its values. >>>> How would you go dong it? >>>> Create a Key Class implementing DataType interface? >>>> Can someone show me an example? >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "H2 Database" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/h2-database. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <javascript:_e(%7B%7D,'cvml','h2-database%[email protected]');> > . > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > Visit this group at http://groups.google.com/group/h2-database. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/h2-database. For more options, visit https://groups.google.com/d/optout.
