Field storage

Field storage

am 03.07.2007 11:35:47 von mrcakey

Utterly perplexed by this one. I entered this into my MySQL:

create table if not exists user
(userid int not null auto_increment primary key,
email char(64) not null,
nickname char(32),
user_pass char(41),
reset_ans char(41),
block_timestamp timestamp,
blocked tinyint,
fail_cnt tinyint,
auth_pending tinyint,
default_home tinyint,
pref_email_newsletter tinyint,
pref_email_own tinyint,
polled tinyint,
nominations tinyint,
songalike_count int );

When it came out at the other end, phpMyAdmin is reporting that all the INTs
are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea what's
going on here?!!!!

Also, a related issue, is it necessary to align the fields in byte pairs?
This comes from my Tandem programming background - data was stored in byte
pairs, so if you had a field that was 5 bytes long for instance, you'd try
to stick an odd-byte field next to it so that space wasn't wasted. Do I
need to do this for MySQL (just using ISAM)?

+mrcakey

Re: Field storage

am 03.07.2007 12:22:28 von Captain Paralytic

On 3 Jul, 10:35, "mrcakey" wrote:
> Utterly perplexed by this one. I entered this into my MySQL:
>
> create table if not exists user
> (userid int not null auto_increment primary key,
> email char(64) not null,
> nickname char(32),
> user_pass char(41),
> reset_ans char(41),
> block_timestamp timestamp,
> blocked tinyint,
> fail_cnt tinyint,
> auth_pending tinyint,
> default_home tinyint,
> pref_email_newsletter tinyint,
> pref_email_own tinyint,
> polled tinyint,
> nominations tinyint,
> songalike_count int );
>
> When it came out at the other end, phpMyAdmin is reporting that all the INTs
> are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea what's
> going on here?!!!!
>
> Also, a related issue, is it necessary to align the fields in byte pairs?
> This comes from my Tandem programming background - data was stored in byte
> pairs, so if you had a field that was 5 bytes long for instance, you'd try
> to stick an odd-byte field next to it so that space wasn't wasted. Do I
> need to do this for MySQL (just using ISAM)?
>
> +mrcakey

To find out what's going on here, I can recommend reading the manual:

http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html

Re: Field storage

am 03.07.2007 12:45:23 von mrcakey

"Captain Paralytic" wrote in message
news:1183458148.394512.69990@q75g2000hsh.googlegroups.com...
> On 3 Jul, 10:35, "mrcakey" wrote:
>> Utterly perplexed by this one. I entered this into my MySQL:
>>
>> create table if not exists user
>> (userid int not null auto_increment primary key,
>> email char(64) not null,
>> nickname char(32),
>> user_pass char(41),
>> reset_ans char(41),
>> block_timestamp timestamp,
>> blocked tinyint,
>> fail_cnt tinyint,
>> auth_pending tinyint,
>> default_home tinyint,
>> pref_email_newsletter tinyint,
>> pref_email_own tinyint,
>> polled tinyint,
>> nominations tinyint,
>> songalike_count int );
>>
>> When it came out at the other end, phpMyAdmin is reporting that all the
>> INTs
>> are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea what's
>> going on here?!!!!
>>
>> Also, a related issue, is it necessary to align the fields in byte pairs?
>> This comes from my Tandem programming background - data was stored in
>> byte
>> pairs, so if you had a field that was 5 bytes long for instance, you'd
>> try
>> to stick an odd-byte field next to it so that space wasn't wasted. Do I
>> need to do this for MySQL (just using ISAM)?
>>
>> +mrcakey
>
> To find out what's going on here, I can recommend reading the manual:
>
> http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
>

Thank you. I had spent a good 20 minutes looking at the manual, but
apparently not at the relevant bit. Seems a very weird thing for phpMyAdmin
to want to add the display length when it's not needed.

+mrcakey

Re: Field storage

am 03.07.2007 13:02:33 von Captain Paralytic

On 3 Jul, 11:45, "mrcakey" wrote:
> "Captain Paralytic" wrote in message
>
> news:1183458148.394512.69990@q75g2000hsh.googlegroups.com...
>
>
>
>
>
> > On 3 Jul, 10:35, "mrcakey" wrote:
> >> Utterly perplexed by this one. I entered this into my MySQL:
>
> >> create table if not exists user
> >> (userid int not null auto_increment primary key,
> >> email char(64) not null,
> >> nickname char(32),
> >> user_pass char(41),
> >> reset_ans char(41),
> >> block_timestamp timestamp,
> >> blocked tinyint,
> >> fail_cnt tinyint,
> >> auth_pending tinyint,
> >> default_home tinyint,
> >> pref_email_newsletter tinyint,
> >> pref_email_own tinyint,
> >> polled tinyint,
> >> nominations tinyint,
> >> songalike_count int );
>
> >> When it came out at the other end, phpMyAdmin is reporting that all the
> >> INTs
> >> are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea what's
> >> going on here?!!!!
>
> >> Also, a related issue, is it necessary to align the fields in byte pairs?
> >> This comes from my Tandem programming background - data was stored in
> >> byte
> >> pairs, so if you had a field that was 5 bytes long for instance, you'd
> >> try
> >> to stick an odd-byte field next to it so that space wasn't wasted. Do I
> >> need to do this for MySQL (just using ISAM)?
>
> >> +mrcakey
>
> > To find out what's going on here, I can recommend reading the manual:
>
> >http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
>
> Thank you. I had spent a good 20 minutes looking at the manual, but
> apparently not at the relevant bit. Seems a very weird thing for phpMyAdmin
> to want to add the display length when it's not needed.
>
> +mrcakey- Hide quoted text -
>
> - Show quoted text -

The writers of phpMyAdmin obviously didn't realise that you didn't
need that information. In their ignorance they went and built it to
display all the relevant information about the fields, for all the
other people who need to know the details. Crazy huh!

I notice the same with MicroSoft Windows. There are things in here
that I find totally unnecessary. So I assume that no one else needs
those features either!

Re: Field storage

am 03.07.2007 13:23:22 von mrcakey

"Captain Paralytic" wrote in message
news:1183460553.581960.33590@g4g2000hsf.googlegroups.com...
> On 3 Jul, 11:45, "mrcakey" wrote:
>> "Captain Paralytic" wrote in message
>>
>> news:1183458148.394512.69990@q75g2000hsh.googlegroups.com...
>>
>>
>>
>>
>>
>> > On 3 Jul, 10:35, "mrcakey" wrote:
>> >> Utterly perplexed by this one. I entered this into my MySQL:
>>
>> >> create table if not exists user
>> >> (userid int not null auto_increment primary key,
>> >> email char(64) not null,
>> >> nickname char(32),
>> >> user_pass char(41),
>> >> reset_ans char(41),
>> >> block_timestamp timestamp,
>> >> blocked tinyint,
>> >> fail_cnt tinyint,
>> >> auth_pending tinyint,
>> >> default_home tinyint,
>> >> pref_email_newsletter tinyint,
>> >> pref_email_own tinyint,
>> >> polled tinyint,
>> >> nominations tinyint,
>> >> songalike_count int );
>>
>> >> When it came out at the other end, phpMyAdmin is reporting that all
>> >> the
>> >> INTs
>> >> are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea
>> >> what's
>> >> going on here?!!!!
>>
>> >> Also, a related issue, is it necessary to align the fields in byte
>> >> pairs?
>> >> This comes from my Tandem programming background - data was stored in
>> >> byte
>> >> pairs, so if you had a field that was 5 bytes long for instance, you'd
>> >> try
>> >> to stick an odd-byte field next to it so that space wasn't wasted. Do
>> >> I
>> >> need to do this for MySQL (just using ISAM)?
>>
>> >> +mrcakey
>>
>> > To find out what's going on here, I can recommend reading the manual:
>>
>> >http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
>>
>> Thank you. I had spent a good 20 minutes looking at the manual, but
>> apparently not at the relevant bit. Seems a very weird thing for
>> phpMyAdmin
>> to want to add the display length when it's not needed.
>>
>> +mrcakey- Hide quoted text -
>>
>> - Show quoted text -
>
> The writers of phpMyAdmin obviously didn't realise that you didn't
> need that information. In their ignorance they went and built it to
> display all the relevant information about the fields, for all the
> other people who need to know the details. Crazy huh!
>
> I notice the same with MicroSoft Windows. There are things in here
> that I find totally unnecessary. So I assume that no one else needs
> those features either!
>

Wow. How dumb do I feel? You really got my number. Facetious gimp

+mrcakey

Re: Field storage

am 03.07.2007 14:27:26 von Captain Paralytic

On 3 Jul, 12:23, "mrcakey" wrote:
> "Captain Paralytic" wrote in message
>
> news:1183460553.581960.33590@g4g2000hsf.googlegroups.com...
>
>
>
>
>
> > On 3 Jul, 11:45, "mrcakey" wrote:
> >> "Captain Paralytic" wrote in message
>
> >>news:1183458148.394512.69990@q75g2000hsh.googlegroups.com. ..
>
> >> > On 3 Jul, 10:35, "mrcakey" wrote:
> >> >> Utterly perplexed by this one. I entered this into my MySQL:
>
> >> >> create table if not exists user
> >> >> (userid int not null auto_increment primary key,
> >> >> email char(64) not null,
> >> >> nickname char(32),
> >> >> user_pass char(41),
> >> >> reset_ans char(41),
> >> >> block_timestamp timestamp,
> >> >> blocked tinyint,
> >> >> fail_cnt tinyint,
> >> >> auth_pending tinyint,
> >> >> default_home tinyint,
> >> >> pref_email_newsletter tinyint,
> >> >> pref_email_own tinyint,
> >> >> polled tinyint,
> >> >> nominations tinyint,
> >> >> songalike_count int );
>
> >> >> When it came out at the other end, phpMyAdmin is reporting that all
> >> >> the
> >> >> INTs
> >> >> are 11 bytes long and the TINYINTs are 4 bytes long. I've no idea
> >> >> what's
> >> >> going on here?!!!!
>
> >> >> Also, a related issue, is it necessary to align the fields in byte
> >> >> pairs?
> >> >> This comes from my Tandem programming background - data was stored in
> >> >> byte
> >> >> pairs, so if you had a field that was 5 bytes long for instance, you'd
> >> >> try
> >> >> to stick an odd-byte field next to it so that space wasn't wasted. Do
> >> >> I
> >> >> need to do this for MySQL (just using ISAM)?
>
> >> >> +mrcakey
>
> >> > To find out what's going on here, I can recommend reading the manual:
>
> >> >http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
>
> >> Thank you. I had spent a good 20 minutes looking at the manual, but
> >> apparently not at the relevant bit. Seems a very weird thing for
> >> phpMyAdmin
> >> to want to add the display length when it's not needed.
>
> >> +mrcakey- Hide quoted text -
>
> >> - Show quoted text -
>
> > The writers of phpMyAdmin obviously didn't realise that you didn't
> > need that information. In their ignorance they went and built it to
> > display all the relevant information about the fields, for all the
> > other people who need to know the details. Crazy huh!
>
> > I notice the same with MicroSoft Windows. There are things in here
> > that I find totally unnecessary. So I assume that no one else needs
> > those features either!
>
> Wow. How dumb do I feel? You really got my number. Facetious gimp
>
> +mrcakey- Hide quoted text -
>
> - Show quoted text -

But at least I answered your original question ;-)

Re: Field storage

am 04.07.2007 09:01:42 von David Quinton

On Tue, 03 Jul 2007 05:27:26 -0700, Captain Paralytic
wrote:


>> Wow. How dumb do I feel? You really got my number. Facetious gimp
>
>But at least I answered your original question ;-)

.... and it WAS quite entertaining...
--
Locate your Mobile phone:
Great gifts: