[#6982] Optimized Tags
Summary Optimized Tags
Queue Ansel
Type Enhancement
State Feedback
Priority 1. Low
Owners Michael Rubinsky <mrubinsk (at) horde (dot) org>
Requester Duck <duck (at) obala (dot) net>
Created 06/26/2008 (73 days ago)
Due
Updated 07/15/2008 (54 days ago)
Assigned 06/30/2008 (69 days ago)
Resolved
Attachments ansel-tags.diff Download
Milestone
Patch No

History
07/15/2008 Michael Rubinsky Deleted Attachment: cloud.php
 
07/15/2008 Michael Rubinsky Comment #11
Milestone ⇒
Reply to this comment
Removing as a showstopper, tags work, this would be a nice performance 
enhancement though, once the gallery vs image tag count issue is 
resolved.
07/02/2008 Michael Rubinsky Comment #10 Reply to this comment
Huh?  Your saving the actual number of tags in ansel_tags.tag_count
Sorry, that should be "the actual number of times that a tag is used in..."

07/02/2008 Michael Rubinsky Comment #9 Reply to this comment
Actually we don't need to know the actual number of images/galleries
tag count. Is used only as a flag if the gallery/image has tags or
not to save later queries. So this can be a boolean value.
Huh?  Your saving the actual number of tags in ansel_tags.tag_count 
and then your using the value of that field directly in 
Ansel_Tags::readTags() and Ansel_Tags::listTagInfo().  With your 
changes, once any tags are added/removed from an image or gallery, the 
tag counts will never be correct because the value in the 
ansel_tags.tag_count field is only taking into account the number of 
times that tag is used in _either_ the images table *or* the galleries 
table, when it needs to be both.
07/02/2008 Duck Comment #8 Reply to this comment
It looks like these changes will cause the tag_count field to be
overwritten with the count of tags in *either* the ansel_images_tags
or ansel_galleries_tags table...when it should be both.
Actually we don't need to know the actual number of images/galleries 
tag count. Is used only as a flag if the gallery/image has tags or not 
to save later queries. So this can be a boolean value.
06/30/2008 Michael Rubinsky State ⇒ Feedback
 
06/30/2008 Michael Rubinsky Comment #7 Reply to this comment
It looks like these changes will cause the tag_count field to be 
overwritten with the count of tags in *either* the ansel_images_tags 
or ansel_galleries_tags table...when it should be both.
06/30/2008 Chuck Hagenbuch Comment #6 Reply to this comment
and why not, a tag cloud page...
To be honest, I feel that an entire page containing only a tag cloud
is a bit, well, boring and wasteful considering that the "Browse"
page can be configured with a cloud of whatever size the user wants.
I agree.
06/30/2008 Michael Rubinsky Milestone ⇒ 1.0
 
06/30/2008 Michael Rubinsky State ⇒ Assigned
Assigned to Michael Rubinsky
 
06/30/2008 Michael Rubinsky Comment #5 Reply to this comment
and why not, a tag cloud page...
To be honest, I feel that an entire page containing only a tag cloud 
is a bit, well, boring and wasteful considering that the "Browse" page 
can be configured with a cloud of whatever size the user wants.   I 
suppose I can be convinced differently if there is a compelling reason 
that I am missing or the Cloud page contained some other widgets/info 
etc...
06/30/2008 Duck Comment #4 Reply to this comment
I'm still looking over the changes here, but why do the
iteration/concatenation in gallery.php instead of using implode()?
Is there a big performance difference?
becouse getTags() does not return one dimentional array anymore but 
even the tag count
06/30/2008 Michael Rubinsky Comment #3 Reply to this comment
I'm still looking over the changes here, but why do the 
iteration/concatenation in gallery.php instead of using implode()?   
Is there a big performance difference?
06/26/2008 Duck Comment #2
New Attachment: cloud.php
Reply to this comment
and why not, a tag cloud page...
06/26/2008 Duck Comment #1
New Attachment: ansel-tags.diff Download
Patch ⇒
Milestone ⇒
Queue ⇒ Ansel
Summary ⇒ Optimized Tags
Type ⇒ Enhancement
Priority ⇒ 1. Low
State ⇒ New
Reply to this comment
The UNION ALL SELECT query is very waste full SQL command. Expecially 
with the kind of table that tags are implemented with. Is taking 
seconds for my installations with a lot of images. As the server must 
read all table data to perform the counting and proper selection of 
data. So we must help the server and perform the count on the rare 
update operations to have fast common selections.

The patch:
reorganize the Ansel_Tags object store the store counts of used tags 
in the tags table to not count on the fly
mark galleries and images if they have tags or not so we can avoid not 
needed queries with all galleries and images that does not have tags.
Add limit functionality to the tags cloud block