Prism-Bukkit icon indicating copy to clipboard operation
Prism-Bukkit copied to clipboard

Separate out action key index from location to speed up lookups

Open lflare opened this issue 5 years ago • 4 comments

Hello there!

Yet another PR from me with some SQL index voodoo magick to help speedup lookups! Like my first PR #194, I am highly confident this PR will only bring about sunshines and rainbows to the performance of Prism.

In a nutshell, there is no reason for the action_id column to be in the same index as the location-based columns. By separating it out into it's own index, the performance gain is exponential. A simple command like /pr lookup a:command t:1y r:global can take about 5 seconds on my server, as compared to more than 15 minutes (before I killed it) without this indexing key!

Unfortunately, because of the way the database engine works, there is no way to modify an existing index, so I tried to take the approach of deleting the whole index location and re-creating it with the correct location-y columns. This may be the most expensive part about this PR, but I believe this change makes the most logical sense and should be carried out!

lflare avatar Jun 06 '20 23:06 lflare

Codacy Here is an overview of what got changed by this pull request:


Issues
======
- Added 1
           

See the complete overview on Codacy

Narimm avatar Jul 26 '20 14:07 Narimm

What's the status of this PR? Is this abandoned?

Huskehhh avatar Dec 12 '20 22:12 Huskehhh

It needs testing on a large dataset until someone has done that and provided the stats its stagnant

Narimm avatar Dec 13 '20 01:12 Narimm

It needs testing on a large dataset until someone has done that and provided the stats its stagnant

Sounds good. I'll jump on this soon 👍

Huskehhh avatar Dec 13 '20 02:12 Huskehhh

This repository is no longer active. You can try to resubmit this at the current Prism repo here https://github.com/prism/PrismRefracted (although, some of these older fix PRs were already adapted, please verify first)

viveleroi avatar Apr 13 '23 03:04 viveleroi