Customizing SMF > Modifications and Packages
Tagging System For Topics (2.4.3 Released)
wirexa:
I managed to ^. ^
pols1337:
Hi vbgamer,
I think I've accidentally installed the Tagging System package twice, so the tags appear twice. See screenshot. I've tried uninstalling and re-installing the package, but that doesn't work. (When I uninstall, it completely removes the entire Tagging System package. When I reinstall, it adds back the double tagging). Can you help me fix this?
Ben_S:
Looking at using this as a base for my new redesign to feed the home page, i.e. topics are tagged and then with a few new ssi features can be pulled out as required, will require a fair bit of stripping down though to remove the tag list and cloud etc as the queries used for them could do with some optimisation. With 286,000 entries in smf_tag_logs, the tags action resulted in a query that ran for over 60 seconds before I killed it. Similar for clicking on a tag in a topic listing. Not a biggie for me as I will be removing those anyway as all I want it the ability to add tags to a topic and pull them out using ssi.php.
When I've added my ssi.php stuff I'll contribute it back in case it is useful to anyone else.
vbgamer45:
Do you know what the exact query was?
Here is what I would do to speed it up
--- Code: ---ALTER TABLE smf_tags_log add index ID_MEMBER (ID_MEMBER);
ALTER TABLE smf_tags_log add index ID_TOPIC (ID_TOPIC);
--- End code ---
This will make those queries process extremely fast.
Ben_S:
Still had it installed so queries below. Adding those indexes doesn't help, still takes over 200 seconds.
action=tags
SELECT DISTINCT l.ID_TOPIC, t.num_replies,t.num_views,m.id_member,
m.poster_name,m.subject,m.id_topic,m.poster_time,
t.id_board, g.tag, g.ID_TAG
FROM (yabbse_tags_log as l, yabbse_boards AS b, yabbse_topics as t, yabbse_messages as m)
LEFT JOIN yabbse_tags AS g ON (l.ID_TAG = g.ID_TAG)
WHERE b.ID_BOARD = t.id_board AND l.ID_TOPIC = t.id_topic AND t.approved = 1 AND t.id_first_msg = m.id_msg AND 1=1 ORDER BY l.ID DESC LIMIT 20
"id";"select_type";"table";"type";"possible_keys";"key";"key_len";"ref";"rows";"Extra"
"1";"SIMPLE";"b";"index";"id_board";"id_board";"2";NULL;"29";"Using index; Using temporary; Using filesort"
"1";"SIMPLE";"t";"ref";"PRIMARY,firstMessage,ID_BOARD,approved,last_message_sticky,board_news";"board_news";"2";"rawk_forum.b.id_board";"2698";"Using where"
"1";"SIMPLE";"l";"ref";"ID_TOPIC";"ID_TOPIC";"3";"rawk_forum.t.id_topic";"1";""
"1";"SIMPLE";"g";"eq_ref";"PRIMARY";"PRIMARY";"3";"rawk_forum.l.id_tag";"1";""
"1";"SIMPLE";"m";"eq_ref";"PRIMARY";"PRIMARY";"4";"rawk_forum.t.id_first_msg";"1";""
?action=tags;tagid=1
SELECT count(*) as total
FROM (yabbse_tags_log as l, yabbse_boards AS b, yabbse_topics as t, yabbse_messages as m)
WHERE l.ID_TAG = 1 AND b.ID_BOARD = t.ID_BOARD AND l.ID_TOPIC = t.id_topic AND t.approved = 1
AND t.ID_FIRST_MSG = m.ID_MSG AND 1=1
"id";"select_type";"table";"type";"possible_keys";"key";"key_len";"ref";"rows";"Extra"
"1";"SIMPLE";"b";"index";"id_board";"id_board";"2";NULL;"29";"Using index"
"1";"SIMPLE";"t";"ref";"PRIMARY,firstMessage,ID_BOARD,approved,last_message_sticky,board_news";"board_news";"2";"rawk_forum.b.id_board";"2698";"Using where"
"1";"SIMPLE";"l";"ref";"ID_TOPIC";"ID_TOPIC";"3";"rawk_forum.t.id_topic";"1";"Using where"
"1";"SIMPLE";"m";"eq_ref";"PRIMARY";"PRIMARY";"4";"rawk_forum.t.id_first_msg";"1";"Using index"
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version