Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2003, 01:26 AM
Elrach
Sarnak
 
Join Date: Apr 2003
Posts: 66
Default Why blobs?

I've been wondering about this for a while. Why are we using blobs in the database? Is it for manageability of the queries? Is there a strategic advantage to using blobs? I always thought blobs were less efficient than other data types. Am I wrong?
__________________
Elrach
Raven City Server
Reply With Quote
  #2  
Old 07-27-2003, 02:54 AM
Merth
Dragon
 
Join Date: May 2003
Location: Seattle, WA
Posts: 609
Default

I don't know about performance; I would assume blobs are more effecient based on how we are using them. Instead of a field by field copy, we're doing one memcpy.

However, performance is not a huge issue with our blobs. They aren't read very often. The item blob is read once and cached. The player profile/inventory data is the only data that is handled consistently throughout a session, but not often enough to worry about performance (imo).

The only reason I see for using blobs is for convenience. It's much less code.
Reply With Quote
  #3  
Old 07-27-2003, 11:15 AM
Bigpull
Discordant
 
Join Date: Feb 2003
Posts: 305
Default

It's a reliability / coding time thing. We use blobs for playerprofile, items, and raw zone points. All of which are cached by the server so the sql's performance isn't really an issue.

There has been talk/code for moving to field based items but the consensus was the field data should only be used to build new blob's
Reply With Quote
  #4  
Old 07-31-2003, 10:47 AM
mByte
Hill Giant
 
Join Date: Feb 2002
Posts: 206
Default

Why not?
__________________
mByte
Reply With Quote
  #5  
Old 07-31-2003, 11:57 AM
DeletedUser
Fire Beetle
 
Join Date: Sep 2002
Posts: 0
Default

Blobs are used for structures because they can easily be converted.
Reply With Quote
  #6  
Old 08-01-2003, 08:01 AM
Elrach
Sarnak
 
Join Date: Apr 2003
Posts: 66
Default

If it was me, I wouldn't use em for the type of data we put in, but since I'm not in charge...

They do make it a pain when you try to query tables, using one of the blob's fields as a key. I.E. I want a list of all leggings, wearable by warriors granting a bonus of between 20-50hp. You have to parse through the data instead of letting the SQL engine do the work.

Of course, that doesn't matter for the Emu, but makes a big diff for those making 3rd party apps.
__________________
Elrach
Raven City Server
Reply With Quote
  #7  
Old 08-01-2003, 09:03 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

Ok, lets say we went to multiple columns instead of a blob, you realize how many columns that would be for inventory alone?

Instead of 1 column in the table we would have:

30 columns for equiped/main inv items + 80 main inv bag columns + 18 bank slots + 180 bank item bag slots
=308 columns, but wait theres more!!!!

30 columns for equiped/main inv items CHARGES + 80 main inv bag CHARGE columns + 18 bank CHARGES slots + 180 bank item bag CHARGES slots
=616 columns, but wait theres more!!!

30 columns for equiped/main inv items COLORS + 80 main inv bag COLORS columns + 18 bank CHARGES slots + 180 bank item bag COLORS slots
=924 columns, just for inventory.
__________________
Lethal Encounter
Reply With Quote
  #8  
Old 08-01-2003, 09:09 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

Blobs are the best format for the way that EQEmu uses them... they were NOT designed to be the best for third party programs, as that would be retarded. If you want to find all leggings that your warrior can wear.. you should probably load them all and then search just as we do.. that way there is less load on the SQL server and you can do more than one search without going through all of the data on SQL again.
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
  #9  
Old 08-01-2003, 09:14 AM
Elrach
Sarnak
 
Join Date: Apr 2003
Posts: 66
Default

Do I get the extra knife that can cut through steel pipe with that too? hehe

Yes, i do realise that. Wonder if we could come up with a happy medium. What if the inventory items for example were in a seperate table. You would have something like char_id, slot_id, item_id, charges, color and other characteristics I might forget.

Items table would be more difficult to reduce the number of columns I think, however.

I'll have a closer look at the blobs and see what I can come up with.
__________________
Elrach
Raven City Server
Reply With Quote
  #10  
Old 08-01-2003, 10:09 AM
Edgar1898
Senior Member
Former EQEmu Developer
Current EQ2Emu Lead Developer
 
Join Date: Dec 2002
Posts: 1,065
Default

actually for the item table with the new 5.0 servers we used columns instead of a blob format. It ended up being around 50 columns. Hmm your idea about a separate table is interesting though.



Edit: It was determined to be a good idea by a couple other devs as well, so Ill code this into 5.0
Note: INV ONLY!
__________________
Lethal Encounter
Reply With Quote
  #11  
Old 08-19-2003, 05:00 PM
mByte
Hill Giant
 
Join Date: Feb 2002
Posts: 206
Default

With the new expansion the way items are done i think will be obsolete.
__________________
mByte
Reply With Quote
  #12  
Old 08-19-2003, 05:08 PM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Yes. The item system was completely redone from what has been said.
Reply With Quote
  #13  
Old 08-19-2003, 05:19 PM
Merth
Dragon
 
Join Date: May 2003
Location: Seattle, WA
Posts: 609
Default

Add FIELD_ITEMS to your preprocessor defines to use the new field based item format you see in db.sql. Else, it will continue to use the old blob format.
Reply With Quote
  #14  
Old 08-20-2003, 02:37 AM
killspree
Dragon
 
Join Date: Jun 2002
Posts: 776
Default

Good deal, thanks for the heads up, Merth!
Reply With Quote
Reply


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 On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:28 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3