pf » Performance of database tag schemas
Performance of database tag schemas
Philipp Keller has done some performance test on 4 different database schemas for storing tagged items. Although his article refers to tagging bookmarks, you can tag pretty much anything.
He tests a one table setup with and without a full text index (tags are just a column in the table), a two table setup (a tag table with a foreign key to the item), and a three table setup (tags, items, and tag item relation table).
I found the results to be somewhat surprising. The full text index is slowest on a small tag set (250 tags) but with (999) tags it was fastest for finding items tagged with two tags.
The three table method was faster than the two table method on all tests except for inserting new rows. The un-normalized one table method is obviously fastest for adding new items. I would guess it would be fastest for update and delete as well.
Note that his tests were done using MySQL, using a different database you might get different results.
Check out his report
add to del.icio.us
| Tags: tags, folksonomy, performance, mysql, sql, db, design
Related Entries
- Insert Delayed with MySQL - August 2, 2005
- Related Posts - April 8, 2005
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL - February 18, 2008
- On Tradeoffs - November 9, 2007
- Calculating Distance in Miles from Latitude and Longitude - January 18, 2007
- CFSCRIPT Cheatsheet
- 3 New Image Effects for ColdFusion 8
- Googlebot to Submit Web Forms
- ColdFusion 8 Update 1 Fixes some Image Processing Quirks
- 10 Most Useful Image Functions in ColdFusion 8
- Speaking at NYC CFUG This Week
- Adobe AIR Tutorial for HTML / JavaScript Developers
- INFORMATION_SCHEMA Support in MySQL, PostgreSQL
RSS
Pete Freitag is a software engineer, and web developer located in










