Appearance Table in database

Development forum for the EQ2Emulator Database project.

Moderator: Team Members

Post Reply
User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Appearance Table in database

Post by ZexisStryfe » Sun Aug 31, 2008 11:46 pm

Alright I have a question.
I was looking at the appearances table today since I have a CSV of all the appearances and was thinking of updating my appearances table. I noticed that there are actually 3 fields in the appearances table though: id, appearance_id, and name.
My question is this- Isn't that rather redundant? appearance_ids are unique, so why do we need the id field? Do we really need two ways to reference these appearances? In my experience this table as a whole is rather useless since I can call ids that aren't in the table with the /race command anyways, but if we insist on keeping the table as reference, then I think we should at least remove the id field and just let the appearance_id serve as the key field for the table.
It only makes sense...
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Sep 01, 2008 12:07 am

PK's (most of the times named `id`) are usually for indexing and reference. It's standard practice to build a table with at least one PK/Index column, then add your particular usage columns after.
Sure, appearance_id may be unique throughout the entire data table - but should there ever be a reason why one needs to be duplicated for _any_ inconceivable, unforseeable reason, you would then be forced to insert an autoincrementing ID field anyway - so why not just do it at design time?
Are you thinking this takes up unneeded data space? Because believe me, there are places where "unneeded data" dominates our tables - and maybe someday down the road, we can address this and the 100 other issues we have relating to database design. :)
(btw, I didn't build the initial structures ~giggle~)

User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Post by ZexisStryfe » Mon Sep 01, 2008 12:12 am

:P :P :P
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Re: Appearance Table in database

Post by LethalEncounter » Mon Sep 01, 2008 11:01 am

ZexisStryfe wrote:In my experience this table as a whole is rather useless since I can call ids that aren't in the table with the /race command anyways, but if we insist on keeping the table as reference, then I think we should at least remove the id field and just let the appearance_id serve as the key field for the table.
It only makes sense...
Sure you can get rid of it. That is unless of course you want the emu to correctly create your character. The emu uses the table extensively during character creation to convert the text the client uses to the IDs. Getting rid of it would result in your character having values of 0 in the following fields: soga_wing_type, soga_chest_type, soga_legs_type, soga_hair_type, soga_race_type, legs_type, chest_type, wing_type, hair_type, and race_type.

User avatar
ZexisStryfe
Posts: 1026
Joined: Thu Jul 26, 2007 6:39 am
EQ2Emu Server: Sytherian Legends
Location: Connecticut
Contact:

Post by ZexisStryfe » Mon Sep 01, 2008 11:18 am

Ah, gotcha LE. I knew there had to be some purpose for it.
Then my next question is, If this table helps convert the SOGA hair type, etc, etc, what is actually preventing that information from being saved? When you create a SOGA character, you loose all of your hair choices along with facial customization.
~ EQ2 Emulator Project Manager

Image
Image
Image
"Zexis, from this day forth, you shall be known as... '3 of 6'" - John Adams

LethalEncounter
Team: Zombie
Posts: 2717
Joined: Wed Jul 25, 2007 10:10 pm

Post by LethalEncounter » Mon Sep 01, 2008 12:25 pm

The information is probably being saved, the structs are most likely off and need fixing.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Mon Sep 01, 2008 2:43 pm

Aye, I remember talking abotu SOGA a while back, and getting that sorted out just wasn't a priority until (possibly) after the beta phase - when the incidentals are perfected.
So aside from my "best practices" excuse for having a seemingly redundant indexing, there is something far greater; LE said so. ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests