[clug-progsig] Storing large bitwise values in MySQL
Nick Wiltshire
nick at customdesigns.ca
Wed May 23 08:07:35 PDT 2007
Somehow Shawn and I accidentally took this thread off list (probably good
because it made me feel stupid when Shawn told me to use a cross referencing
table, which in retrospect should have been my first solution).
I'm curious though, can you put arbitrary binary data into CHAR(32)?
On Wednesday 23 May 2007 08:52, Roy Souther wrote:
> I would not use a BLOB or a very large INT because at some point in time
> you may want to use another database and that could cause problems
> moving the code over.
>
> According to http://en.wikipedia.org/wiki/List_of_countries there are
> 245 countries that you would need to identify so a string of 32 chars
> would give you a bit field selection range of up to 256 bits.
>
> Regardless of if you use CHAR(32) or a BLOB or a very large INT you are
> still going to have to code your own function to perform the logic on
> the bit field and the data type does not matter.
>
> The question you need to ask is "Is speed and issue?" and if so then
> maybe you should look at all three and see how speed will be affected by
> the storage type and the logic function you write.
>
> On Tue, 2007-05-22 at 16:56 -0600, Nick Wiltshire wrote:
> > Hi all,
> >
> > this might not even be the correct way to go about it, but I need to
> > store a multiple-select value with the possible choices being the
> > countries of the world.
> >
> > Should I use a BLOB, a _really_ big INT or go about it some completely
> > different way?
> >
> > Nick
> >
> > _______________________________________________
> > clug-progsig mailing list
> > clug-progsig at clug.ca
> > http://clug.ca/mailman/listinfo/clug-progsig_clug.ca
>
> Royce Souther
> www.SiliconTao.com
> Let Open Source help your business move beyond.
>
> For security this message is digitally authenticated by GnuPG.
More information about the clug-progsig
mailing list