Unix Technical Forum

TagCloud Table Structure?

This is a discussion on TagCloud Table Structure? within the MySQL forums, part of the Database Server Software category; --> Hi. I need some help with a tag-cloud. I am wondering a few things: 1) Should I be allowing ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-07-2008, 02:29 PM
pbd22
 
Posts: n/a
Default TagCloud Table Structure?

Hi.

I need some help with a tag-cloud.
I am wondering a few things:
1) Should I be allowing repetition in my table inserts?
2) I am assuming yes, and, if this is the case, then I am
guessing that the count goes up for all tags of the same name?
How is that done?

Below is my table structure:

CREATE TABLE IF NOT EXISTS mcs.tagcloud (
TagID int(10) unsigned NOT NULL auto_increment,
ScheduleID int(10) unsigned NOT NULL,
Tag varchar(100) NOT NULL,
count int(11) NOT NULL default '0',
hits int(11) NOT NULL default '0',
PRIMARY KEY (TagID),
KEY ScheduleID (ScheduleID),
FOREIGN KEY (ScheduleID) references CommonSchedule(ScheduleID) on
delete cascade on update cascade
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-09-2008, 01:37 PM
Bruno Barberi Gnecco
 
Posts: n/a
Default Re: TagCloud Table Structure?

pbd22 wrote:
> Hi.
>
> I need some help with a tag-cloud.
> I am wondering a few things:
> 1) Should I be allowing repetition in my table inserts?
> 2) I am assuming yes, and, if this is the case, then I am
> guessing that the count goes up for all tags of the same name?
> How is that done?


Why not do something like this:

CREATE TABLE tag (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
tagname VARCHAR(50) NOT NULL,

PRIMARY KEY(id),
UNIQUE(tagname)
);

CREATE TABLE tag_schedule (
tag INTEGER UNSIGNED NOT NULL,
target INTEGER UNSIGNED NOT NULL,

PRIMARY KEY (tag, target),
KEY (tag),
KEY (target),
FOREIGN KEY (tag) REFERENCES tag(id),
FOREIGN KEY (target) REFERENCES Schedule(id)
);


--
Bruno Barberi Gnecco <brunobg_at_users.sourceforge.net>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-09-2008, 01:37 PM
pbd22
 
Posts: n/a
Default Re: TagCloud Table Structure?

Bruno, would you mind elaborating on what you have suggested.
Also, tags need to be evaluated based on "popularity" which means
that they increase in value if somebody clicks on an image.

Thanks again,
Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com