Wrox Programmer Forums
| 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 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
  #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


Similar Threads
Thread Thread Starter Forum Replies Last Post
gathering usernames with asp.net regwood79 ASP.NET 2.0 Basics 1 January 26th, 2006 11: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 08:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.