I have a basic blog MySql table:
CREATE TABLE IF NOT EXISTS `blogs` ( `id` int(11) NOT NULL AUTO_INCREMENT, `blogText` text NOT NULL, `allowcomment` tinyint(1) NOT NULL, PRIMARY KEY (`id`) )
I want to keep track of how may times I query each row. Basically keeping tracks of view. I really don’t want to create a table to keep track of IP address and insert an Ip address and blogs.id as a unique key. Then count number of unique keys in that table.
I want to be as efficient and accurate as possible.
you need to create a new table or column for keeping count. and use a
triggerto update count after each select query. That is the way to do, I think.