MySQL Forums
Forum List  »  Performance

Re: Memory mirror for read-only tables?
Posted by: Thomas Courl
Date: August 12, 2009 02:31AM

Rick, thanks a lot: extremely helpful!

To complement my previous post / extra questions:
- My select looks like: SELECT bigint_val, float_val WHERE int_val=xxxxx; (this returns ~5000 rows out of the ~15mln). The int_val are within [0, 60000] (with ~3000 different values) but I only retrieve 1 at the time => it seems that HASH index is better.

- The bigint_val is needed but, as you mentionned, no index required.

- I LOVE the "out of the box" idea. It should work as my objective is to store the returned rows in a (java) HashMap cache where the key is bigint_val and the value is float_val (i.e. no SUM, AVG, etc.). Hence, storing the 5000 rows into a single one sounds great.

This triggers 2 extra-questions:
1. I would have to encode the float_val and bigint_val as 12 bytes chunks (4+8) in the BLOB and decode the BLOB column in java (I hope I can retrieve it as a byte array in java)? I would not want to store it in ASCII/Text format as it would require significant additional storage .
2. The BLOB column would require ~12bytes * 5000 =>60kb. Is there a max size for BLOBs, or even rows in general?

Again, many thanks for your support!
Thomas

Options: ReplyQuote


Subject
Views
Written By
Posted
4727
August 11, 2009 05:43PM
Re: Memory mirror for read-only tables?
2078
August 12, 2009 02:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.