Successfully reported this slideshow.

Under the Hood with MySQL

4

Share

Upcoming SlideShare
Accessibility with WordPress
Accessibility with WordPress
Loading in …3
×
1 of 27
1 of 27

Under the Hood with MySQL

4

Share

Download to read offline

A look at Koha’s internal database structure using the mysql command-line. This isn’t to teach you SQL, but where to look in Koha tables for relevant data. - Joe Atzberger

A look at Koha’s internal database structure using the mysql command-line. This isn’t to teach you SQL, but where to look in Koha tables for relevant data. - Joe Atzberger

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

Under the Hood with MySQL

  1. 1. Under the Hood with MySQL Joe Atzberger, LibLime KohaCon 2009: Plano, TX
  2. 2. SQL Control
  3. 3. SQL Control •Baseline: installer/data/ mysql/kohastructure.sql
  4. 4. SQL Control •Baseline: installer/data/ mysql/kohastructure.sql •Updates: installer/data/ mysql/updatedatabase.pl
  5. 5. SQL Control •Baseline: installer/data/ mysql/kohastructure.sql •Updates: installer/data/ mysql/updatedatabase.pl •This defines Koha’s Version!
  6. 6. SQL Control •mysqldump --no-data --xml -uyouruser -pyourpass koha_db >dump.sql •~125 tables •~1773 lines of XML So what do you use to look at it all? •That is a lot of stuff.
  7. 7. SQL Tools • phpMyAdmin: web based table control, a great way to break everything and not be able to fix it. I once performed a tech inventory for the State • MySQL Administrator, MySQL Query of Ohio in one of its smaller departments. The single largest line item was $427,000 for 7 Browser: Free and “official”. boxes of Oracle soft ware. • Tons of OSS applications. Varying quality. • Tons of proprietary software. Varying cost.
  8. 8. DB Design Principles • Limit duplication of values • Put related data together • Proper data typing • Keys, indexes, etc., etc., etc.
  9. 9. DB Design Principles
  10. 10. DB Design Principles Does Koha do this?
  11. 11. DB Design Principles Does Koha do this? • Yes
  12. 12. DB Design Principles Does Koha do this? • Yes • and No.
  13. 13. DB Design Problems • MARC: not a relational design. • MARC: limits on record dimensions. • MARC: performance implications. • Battle of MARCs. Legacy code and data. • FRBR, holdings, bindings, serials, etc. • Excuses, excuses, excuses...
  14. 14. Core tables
  15. 15. Core tables • systempreferences: system preferences
  16. 16. Core tables • systempreferences: system preferences • branches: the most frequently keyed table
  17. 17. Core tables • systempreferences: system preferences • branches: the most frequently keyed table • borrowers: users, patrons, staff, people, whomever
  18. 18. Core tables • systempreferences: system preferences • branches: the most frequently keyed table • borrowers: users, patrons, staff, people, whomever • biblio: title level
  19. 19. Core tables • systempreferences: system preferences • branches: the most frequently keyed table • borrowers: users, patrons, staff, people, whomever • biblio: title level • biblioitems: marc & marcxml, going away soon
  20. 20. Core tables • systempreferences: system preferences • branches: the most frequently keyed table • borrowers: users, patrons, staff, people, whomever • biblio: title level • biblioitems: marc & marcxml, going away soon • items: where the barcodes live
  21. 21. Parallel tables • deletedxxx: biblios, items, biblioitems, borrowers • old_xxx: old_issues, old_reserves. Need more.
  22. 22. Black Magicks You won’t be importing to any of these tables. Very application specific. • marc_subfield_structure • marc_tag_structure
  23. 23. So what’s left? • Paul covered structure • Nicole handled queries
  24. 24. Pretty pictures?
  25. 25. Pretty pictures? • http://wiki.koha.org/doku.php? id=en:development:dbschema:3.01
  26. 26. Pretty pictures? • http://wiki.koha.org/doku.php? id=en:development:dbschema:3.01 • Not that pretty!
  27. 27. The End?

×