A Space & astronomy forum. SpaceBanter.com

Go Back   Home » SpaceBanter.com forum » Astronomy and Astrophysics » Astronomy Misc
Site Map Home Authors List Search Today's Posts Mark Forums Read Web Partners

bigint in mysql



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 28th 03, 04:24 PM
Allan Adler
external usenet poster
 
Posts: n/a
Default bigint in mysql


The object ID of an celestial object in the Sloan Digital Sky Survey is
described as a 64 bit integer. If I want to make my own mysql database
for a few items I've downloaded (just for my own education), I can preumably
declare the column for that object ID a bigint. This object ID actually
encodes 6 other items, called skyVersion, field, run, rerun, camcol, obj,
which can be extracted from the object ID by partitioning the 64 bit binary
representation of the object ID.

The documentation for mysql leaves me a little puzzled as to how to
declare the object ID. I'm not even sure whether it really supports 64
bit unsigned integers or only 63 bits. There are some comments about
giving wrong answers at the most significant bits. It also says something
about declaring the bigint as a string and mysql being smart enough to
automatically convert it to an integer. It also says something about
arithmetic with these bigints being treated using doubles, i.e. floating
point, which it is the purpose of the string version to avoid.

Question 1: How do I declare the object ID (e.g. calling it objID) as a 64
bit integer in mysql?

Question 2: How should I extract the various items skyVersion, field, run,
rerun, camcol, obj from objID? I could do it, for example, by first dividing
objID by 2^16 to get obj as a remainder, dividing the quotient by something
else to get the next field as the remainder, dividing the new quotient
and so on. Would that get me involved in the floating point stuff that
one is trying to avoid? In any case, is there a mysql command that will
simply partition a 64 bit binary int into specified pieces?

Ignorantly,
Allan Adler


************************************************** **************************
* *
* Disclaimer: I am a guest and *not* a member of the MIT Artificial *
* Intelligence Lab. My actions and comments do not reflect *
* in any way on MIT. Moreover, I am nowhere near the Boston *
* metropolitan area. *
* *
************************************************** **************************

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 SpaceBanter.com.
The comments are property of their posters.