Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 1st, 2006, 01:24 AM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default usernames as keys

Forgive me if this is answered in the book (my copy hasn't arrived yet, but I've been pouring over the source code). It seems to me that storing usernames as the keys to user records (as opposed to say an int) is highly inefficient. Sure, in ASP.NET membership, the username is fixed, but doesn't this add a lot of unnecessary data to every single forum post? For a highly active forum (say 50,000 posts), you'd be storing nearly 10MB of username data alone in the database.

I'm curious what tradeoffs went into making this decision.

Love the site and what I've seen so far of the book online, by the way. I can't wait until my copy arrives!

  #2 (permalink)  
Old June 1st, 2006, 09:47 PM
Authorized User
 
Join Date: May 2006
Location: , , .
Posts: 99
Thanks: 0
Thanked 1 Time in 1 Post
Default

I think I have an answer. The datakey "Username" is chosen usually for an ASP server control, like Gridview, not as a database key. The Username is unique so can be used effectively in server controls.

  #3 (permalink)  
Old June 4th, 2006, 03:07 PM
Registered User
 
Join Date: Jun 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm not sure I understand your answer... What do you mean by "chosen for server controls?" You can do a join in your select to pull the username from the ID-to-name cache table and store a bunch less data in your forums tables.



  #4 (permalink)  
Old June 5th, 2006, 07:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Atlanta, Georgia, USA.
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sometimes the tables aren't in 3rd normal form because of performance concerns. I can't comment on this specific example, but the first edition suffered from some performance issues because of excessive joins needed to get data in critical paths.

Eric
 


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
gathering usernames with asp.net regwood79 ASP.NET 2.0 Basics 1 January 26th, 2006 10:37 PM
When to define primary keys and foregin keys? method SQL Server 2000 1 August 26th, 2005 09:14 AM
Shortcut keys! Dharam80 Access 2 August 18th, 2005 08:23 AM
AD Usernames ldoodle Classic ASP Basics 1 June 29th, 2005 02:36 PM
Registry Keys reyboy General .NET 2 March 21st, 2005 07:25 PM



All times are GMT -4. The time now is 05:18 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.