Jump to content

Poor SQL Table Indexing


Cookie

Recommended Posts


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  213
  • Reputation:   109
  • Joined:  05/21/12
  • Last Seen:  

bugreport:3289

I've toyed around with this bug report for awhile, and we haven't acted upon it yet. Due to the nature of the bug report, possible change significance to the core, and the latter, I figured we'd create a topic after our IRC discussion we had tonight. I know there's a lot of talented DB experts on the rAthena team, and I'd like to see everyone's angle on this bug report so we can come up with a plan to implement. One of us could easily throw in fixes, and changes but I believe everyone contributing to the changes is the best idea - whether it's ideas, or code. The ultimate goal, of course, is to decrease the execution time of queries, and to improve performance.

@Ind contributed a diff in the bug report tonight. It was a few changes he made while discussing with us over IRC. I'd say taking a look at the bug report, and viewing his ideas would be the best start. :)

Finally, prior to implementing it if we do alter tables and manipulate constraints, and what-not, we'll want to publicly make it apparent (at least in my opinion) - digest, noticeable commit, and such. The goal of this thread is to make sure we fix the poor performance, and properly implement it with as least repercussions as possible.

Discuss! :)

P.S. - I'll use my server as a guinea pig as I do a lot for rA commits. ;) My poor players.

Edit #1:

I forced @Trojal into #rdev last night (his precious 80 minutes of his life gone) as he didn't want to write a novel in response to this post. Here is what he came up with for indexing:

For Control Panel / general usage:

auction:

inventory:

storage:

guild_storage:

cart_inventory:

nameid

card0

card1

card2

card3

For existing application queries:

pet:

char_id

friend:

friend_id

char:

class OR fame

name

guild:

name

mercenary:

char_id

party:

name

ipbanlist:

rtime

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  764
  • Reputation:   220
  • Joined:  11/14/11
  • Last Seen:  

Well, that's funny. I never saw that topic because it's hidden in the Core section. It's obviously a database issue...

The poor indexing results from not knowing how the table will be used when creating it - that's kind of normal. Most of the suggestions theultramage wrote are pretty simple to see if you know how the table is used by the server.

Just add indexes on the columns that are used to look up the results and the task is done. (Actually that's what theultramage suggested 3 years ago...)

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.00
  • Content Count:  213
  • Reputation:   109
  • Joined:  05/21/12
  • Last Seen:  

Well, that's funny. I never saw that topic because it's hidden in the Core section. It's obviously a database issue...

The poor indexing results from not knowing how the table will be used when creating it - that's kind of normal. Most of the suggestions theultramage wrote are pretty simple to see if you know how the table is used by the server.

Just add indexes on the columns that are used to look up the results and the task is done. (Actually that's what theultramage suggested 3 years ago...)

Right, Trojal broke it down in a list. Agreed. +1.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...