 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 22nd, 2012, 04:05 AM
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Choosing appropriate data type
Hello Imar,
Although you have chosen int data type for all type of records, e.g. for Genre Id, you have chosen int data type. Which is not necessary for Genre record.
It makes the application development faster, but I still want to know that
Is it fine to choose int for any record?
Doesn't it take a little more processing time than tinyint, smallint?
Won't it waste database space unnecessarily?
Many thanks....
|

January 22nd, 2012, 05:38 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
I prefer consistency over the optimal data type. That is, using ints everywhere makes your code a little easier to use. I doubt you'll be able to measure the performance difference between an int and a tinyint in an ASP.NET application.
But choose what works best for you; smaller datatypes indeed work for for tables like Genre.
Imar
|

January 22nd, 2012, 06:09 AM
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
I too prefer and it is really headache to remember different data types all the time.
But what about space that the larger data type will take...
|

January 22nd, 2012, 06:42 AM
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Thanks,
prior asking here I had asked the same here but they said for your data base life you should go for smallest data type.
(first 2 replies)
I was little confused so I ask here as I broadly follow your steps.
Why link to amazon??? 
|

January 22nd, 2012, 06:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> but they said for your data base life you should go for smallest data type.
Yes, that's what you typically do, but as I said earlier, I prefer consistency over the smallest data type when size is not that relevant.
The link to Amazon is to show how cheap large hard drives are. Unless you're storing billions of records, the int versus tinyint is not, IMO, a relevant discussion on storage....
Imar
|

January 22nd, 2012, 06:57 AM
|
Friend of Wrox
|
|
Join Date: Oct 2009
Posts: 341
Thanks: 14
Thanked 3 Times in 3 Posts
|
|
Ok fine, I will go to int.
Quote:
The link to Amazon is to show how cheap large hard drives are. Unless you're storing billions of records, the int versus tinyint is not, IMO, a relevant discussion on storage....
|
feel good to know that you too kid.
Thanks a lot
|
|
 |
|