Re: SQL Humor
Date: Thu, 18 Aug 2005 23:03:14 GMT
Message-ID: <Ss8Ne.91834$G8.47009_at_text.news.blueyonder.co.uk>
"Mikito Harakiri" <mikharakiri_nospaum_at_yahoo.com> wrote in message
news:1124405438.921335.308080_at_g47g2000cwa.googlegroups.com...
> Stu wrote:
>> if you disregard the differences here
>> because of substantial resources, why bother with any sort of datatype
>> at all? If a varchar(50) will do the trick of a char(10), what's 42
>> extra bytes? In the days of terabytes sized RAID arrays, why not use a
>> varchar (8000) for everything? Why use an integer if a varchar will
>> do? Obviously at some point, there will be a performance impact; why
>> not be disciplined enough to strike at the lowest level of that curve
>> and use the least expensive resource that is the best fit for your data?
>
> Humans are notoriously bad at storage management. Storage layout is
> something that has to be hidden and managed automatically. When did you
> specify memory parameters for your web browser program (Let see: 10M
> for fonts, 15M for web pages cache, 5M for cookies, or, wait a minute,
> maybe 2M for cookies would make my browser faster?)
>
> I want a string datatype, and can't possibly predict (and don't really
> care) how long it would be. Is it so difficult to design a RDBMS engine
> that would allow me to declare a string of arbitrary length with some
> rudimentary intelligence as far as storage is concerned?
>
For that instance use a VarChar(8000) or even a Text column. When you do know the structure of the data that you'll be storing, specify it. IMO, the root of assigning datatypes is partly for performance and partly for clarity. If you're able to specify that a UK Postcode is at most 8 characters long, then do so. If it's possible that your column could contain the text from war and peace, make is capable of doing so.
The imporant thing here is that you have the choice. By making the smarter decision means that there's a possibility that you'll be rewarded with a slight database performance boost. As I said in another post, making lots of smart decisions will add up and the overall performance will be significant.
Regards
Colin Dawson
www.cjdawson.com
Received on Fri Aug 19 2005 - 01:03:14 CEST
