Template talk:Weapon query

From Another Eden Wiki

About this board

Planning optimizations for weapon\armor queries and rows

10
Voiddp (talkcontribs)

Since goal of this template is solved by just order by field. And due to row templates and armor templates to be to heavy on the page loads. Because of subqueries in each row to get materials, material icons etc.. What I am planning to do with it:

  • Template:Equipment material add index field to db and add ability to store indexes mats from item\weapon\armor templates.
    • Refill equipment materials db with indexes
  • Template:Material - save images\icons of mats on store, with help of Template:Material icon to db. To shift icons filling load to material pages, from table pages.
    • Refill Materials db table with all icons.
  • Create query for Weapon\Armor tables that will join db tables Weapon + Equipment materials + Materials (for icons), to send full row data into updated row template that will only have display functions without any subqueries.
    • Put code of this new more complex query for weapons here with some parameters, to reuse on other pages
    • Remove sub-queries from Weapon\Armor\Item Row templates.
OpenStars (talkcontribs)

Another suggestion: I did not at first notice that https://anothereden.wiki/w/Template:Equipment_table exists - it is never used anywhere, and it does not do quite the same thing, and also I like how the various subpages of this one allows lower level functionality, but it is a more advanced beginning that we could adjust to work in what we want to see done here. So I propose that we aim to extend that one, with the aim to eventually delete this?

OpenStars (talkcontribs)

Btw I love the much more elegant solution with IF() in the Weapons page query for each type. I spent a lot of time trying with CASE(), FIELDS(), {{#switch}} and , even a left join using VALUES() that should have been much more efficient than a deeply nested if, but nothing worked b/c most SQL functions are disabled for Cargo. I definitely missed the fact that IF() works (I skipped right over it at https://www.mediawiki.org/wiki/Extension:Cargo/Querying_data).

In the future if we are concerned about efficiency (a couple pages have large sets but most pages such as Cursed Time Weapons Set have only small ones, and the large ones do not get run all that often), you could add the VALUES() function to $wgCargoAllowedSQLFunctions[], or we could even construct a new Cargo db for that purpose, to enable the significant efficiency of that left join procedure (that seems overkill but if VALUES() is unsafe for whatever reason...).

Voiddp (talkcontribs)

well main reason i dropped that cause those big pages stated to hit limits, so had to divide equipment pages into <60 and 60 remove mat icons and so on. So as simple as possible in 1 query, to remove some load, became more important then adding levels of logic by some template.

Need to finish those optimizations of db fields and row templates first and to look at result of what it will win...

OpenStars (talkcontribs)

Uh oh, I thought you were just going to seamlessly change the underlying per-row Templates, so to help prepare for that I started switching over *many* pages to use the Equip table template that just used "Weapon row" or "Armor row". That includes Weapons, Armor, their lvl1-59 counterparts, and about half of the equipment sets - so except for the lvl 60 Armor page that you reverted, all of these 26 pages are now broken (including major ones like Weapons), and many have additional helpful changes too such as helpful links to the content they derive from (e.g. reforged adds a link to the Wandering Blacksmith), so if we undo all of them I'll still have to go back and integrate those other changes.

Sorry about stepping on your toes - I should have responded sooner announcing my intentions to do that. How can I help best now - should I stay out of the way entirely for awhile, or start changing things to try to fix this currently broken status? My immediate thought would be to temporarily revert your latest changes to Template: Equipment table, and even continue the overall wiki-wide integration efforts while the new template coding remains in testing status, and then once it fully works it will be only a single change to the Template to swap out the old functionality for the new (which ofc is the entire point of having a single central Template - so it will be a huge success for the entire endeavor:-). But for right now should I refrain from doing anything else so that I don't step on your toes further?

Voiddp (talkcontribs)

they fixed themselves, after passing some params and variables there for headers and formats.

but filters are better to be standalone template on top of this one, to not repeat it for each set inside SideStory pages..

Voiddp (talkcontribs)

will be maybe doing some tweaks later and updating info about it..

main points are

  • /filter
  • /header
  • main template
    • |Weapons/Armor/Items
    • |where=


and unified |format= parameter to pass some formatting things as text string

matterialsOff is there just for comparability with those pages..


ps: and weapon pages loading times now at 2s realtime even with mat icons.. It was smth like 9s at this point before.

OpenStars (talkcontribs)

Thank you for all that you do for this community!:-)

OpenStars (talkcontribs)

I plan to add a new icon in the upper-right of the picture area to act as an indicator that a weapon or armor can be upgraded further, including reforging. I may hold off though until making the secondary headers in connected tables more visible with background shading (especially in Dark Mode). Should I wait to do any of this tinkering? (or feel free to claim either of these ideas and do it yourself if it sounds interesting to you - there's so much to do that we will never get bored:-)

Voiddp (talkcontribs)

just dont add queries inside row template... was doing all this to remove them all from there mostly, and keep 1 main query format and simplest html display, to shorten processing time.

Weapons that can be upgraded are already visible by +10, so some icon can be added based on that, there is already passed parameters for that inside row template. But as for reforgeable.. not sure how to connect without additional querying. Unless field is added to weapon db so it can be passed into row. Because |connectedWeapons= field is virtual link to be just visible on weapon page template at this point and isn't saved.

Reply to "Planning optimizations for weapon\armor queries and rows"
There are no older topics