This is a static copy of the main wikispot.org site, preserved for historical purposes only. Please see this page for more information.

Database Development

InfoInfo TalkTalk
Search:    

    1. Tables in alphabetical order
      1. all_pages
      2. current_pages
      3. events
      4. files
      5. links
      6. mapcategorydefinitions & mappointcategories
      7. map_points
      8. metadata
      9. old_files
      10. oldimageinfo
      11. oldmappointcategories
      12. oldmappoints
      13. pagedependencies
      14. thumbnails
      15. user_favorites
      16. users
      17. user_sessions

Goals for first pass

I am not convinced (i've been going back and forth) of the idea that we should create short and meaningless primary keys (auto increment) when we have meaningful natural primary keys and no visible performance issues related to using them. The rationale was that using integer primary keys will speed up joins, but I am unsure that this is an issue for our dataset (or if it is even true? i am not sure i can say what the db is really doing in these cases). Before I'd feel comfortable creating meaningless primary keys and dealing with the cruft associated with using them I'd want to see what the actual gain would be — meaning, a query that is using such natural keys and a query that's not and the speed difference (or the query plan associated with it that shows a clear difference1). If there was a real sizable performance difference and it was worth the cruft then we'd certainly ought to go with it! I just don't want us to over-engineer something that may not need it.

Also, consider the fact that using auto incremented primary keys ends up being a scale issue on the other end of things — once you have more than one machine working together on the database you have to maintain these auto-incremented keys and can't partition your dataset without doing voodoo. So, I'd want this to fix performance issues we're seeing in the short term. It just seems like, looking at it, that it will end up making the whole database much more complex if we do use these meaningless auto-incremented fields.PhilipNeustrom

Tables in alphabetical order

all_pages

add:

change:

remove:

keys:


current_pages

add:

change:

keys:

note:
propercased_name is the name that the user intended for the page. this will be the single location for that name, since we don't track name revisions (right?) **

we have a cascade issue if a page is deleted - many other tables have page as fk. trigger to point those pages to page 0 "deleted page"? **

pass 2 should add fields to implement cache expiry


events

change:

keys

note:


files

add:

change:

keys:

note:

imagecaptions/imageinfo

This needs a redesign. This should be a 1:many table relating one file to the many pages where it may be displayed (if that relationship is even necessary or used). All the info can be combined. Research image usage first before combining. **


links

add:

change:

remove:

keys:


mapcategorydefinitions & mappointcategories


map_points

add:

change:

remove:

keys:

note:
the id is not currently used so the current address is 1:1 with pages. need to update the address macro to update the sequence number and render multiple addresses on a page.


metadata

not used, delete. this looks like it was supposed to be tags once upon a time.

I just deleted all references to metadata (change #674 ) -Scott Beardsley 5/20/07 7:22 PM

old_files

same changes and keys as files plus:

change:

keys:


oldimageinfo

probably a delete - aren't all the changes in images tracked because a text macro is used to embed them? **


oldmappointcategories

delete - not used


oldmappoints

not used and probably not necessary since changes in address are textual and tracked with the changes to the page. A redesign of the geo-features might want to track changes, but that's out of scope for the first pass.


pagedependencies

this is the dual of links, right? if a links to b, then b depends on a? delete if there's no other use for it **


thumbnails

need to research image relation more before fixing this. a thumbnail is just another image - might be better to use one image class for all **

user_favorites

add:

change:

fk:

note: find out what viewtime is used for **


users

change:

remove:

keys:

note:


user_sessions

change:

note:

This is a Wiki Spot wiki. Wiki Spot is a 501(c)3 non-profit organization that helps communities collaborate via wikis.