
Originally Posted by
r937
please do a SHOW CREATE TABLE for each of the tables, so that we can see the indexes that are defined
what are the relationships between the tables? i mean the one-to-many relationships, which table is the "one" and which table is the "many"
Hi and thanks for the quick reply!
Many tags relate to one bookmark.
Many links relate to one bookmark.
Code:
CREATE TABLE IF NOT EXISTS `bookmarks` (
`id` int(11) NOT NULL auto_increment,
`url` text,
`title` text,
`snippet` text,
`datetime` datetime default NULL,
PRIMARY KEY (`id`),
KEY `datetime` (`datetime`),
FULLTEXT KEY `title` (`title`,`snippet`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4640 ;
Code:
CREATE TABLE IF NOT EXISTS `links` (
`id` mediumint(11) NOT NULL auto_increment,
`user_id` mediumint(11) NOT NULL,
`bookmark_id` int(11) NOT NULL,
`status` enum('public','private') NOT NULL default 'public',
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4627 ;
Code:
CREATE TABLE IF NOT EXISTS `tags` (
`id` mediumint(11) NOT NULL auto_increment,
`user_id` mediumint(11) NOT NULL,
`bookmark_id` mediumint(11) NOT NULL,
`tag` text NOT NULL,
UNIQUE KEY `id` (`id`),
FULLTEXT KEY `title` (`tag`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=31496 ;
Bookmarks