On 3/28/02 1:39 PM [EMAIL PROTECTED] wrote: > > What I want to do is have a database that keeps track of large distribution > lists. Each list has a unique ID, an owner (which is a reference to an ID in > another table) and a creation date. > > My question is this: Would it be more efficient to have each entry in the > list stored in this table in the database, or would I be better off having a > reference to a file that is stored on the hard disk? > > Users must be able to view, add, modify and delete entire lists and single > entries in the lists. >
I would recommend: A table of lists (one row for each list with owner, ID and creation Date (add modification date?)) A table of list entries (one row for each entry) A third table linking the list to list entry. You may have to parse the lists at first to separate the list entries but this method maintains a lot of flexibility: To delete an entire list remove the row from the lists table. This would allow you to maintain the list entries separately or you could also use a "DELETE FROM linkingTable WHERE listID=$whatever". Deleting individual records would involve a single row in the list entry table and a "DELETE FROM linkingTable WHERE listEntryID=$whatever". You probably would not have to sacrifice speed for flexibility: in small tables (<200 records with an index) this type of operation takes less than .001 of a second on my (shared) server. Hope this helps! Chris -- Chris Adams Cypress Lake Studios Hypermedia, Quicktime, and Internet Design http://www.cypresslakestudios.com [EMAIL PROTECTED] --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php