On Wed, Jun 24, 2009 at 9:30 AM, Paul McNett <[email protected]> wrote:
> MB Software Solutions, LLC wrote: > > Paul McNett wrote: > >> Steve Ellenoff wrote: > >>> What kind of performance penalty is there compared to integers when > >>> doing joins? > >> I'm not sure if there's any penalty or benefit, or what that > penalty/benefit would > >> be. I've never had the need to profile my join performance. > > > > > > I'm not sure if the performance penalty would be anything but > > negligible. It would create a larger index file since each key is 40 > > characters (...is that right? 40?) instead of a 4-byte field like > integers. > > I'm not sure there wouldn't be a (negligible) performance benefit. Sure, > the keys are > larger, but they are also more balanced, so an index seek algorithm could > find the > needle in the haystack faster. > --------------------------------------- If this is indexed it matters on the type of index that your stated in your alterdb statement. All outside of VFP data, but that was the gist of this thread right? Crating a "Primary" key on a char() data type will force the db engine to make a guid as well even though you do not see it listed, that is what the engine is probably going to do, many vendors in this arena and most gen a guid for internal use. You really have to understand what your backend is doing with an index. Complex is an understatement! Oracle basics on Primary Key. http://www.techonthenet.com/oracle/primary_keys.php Why cluster a Primary Key: http://bytes.com/groups/ms-sql/81459-why-cluster-primary-key Do you understand what clustering is and how it works for you and against you? Now when you include multiple columns for primary key so they will ROCK in query time later because you are always going to have to split out of every table a join condition via 2,3 columns keeping this data in an index becomes a RPITA for the engine at Insert time. When I query my system indexes data: schema table index name column index type unique dbo accounts pk_accounts practice_id NONCLUSTERED 1 dbo accounts pk_accounts acct_id NONCLUSTERED 1 That is my primary key for the accounts table /\ -- Stephen Russell Sr. Production Systems Programmer SQL Server DBA Web and Winform Development Independent Contractor Memphis TN 901.246-0159 --- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html --- _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

