Firebird database that does not burn your data

2,615
-1

Published on

A short lecture to display some key features of Firebird SQL

Published in: Technology
2 Comments
2 Likes
Statistics
Notes
No Downloads
Views
Total Views
2,615
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
16
Comments
2
Likes
2
Embeds 0
No embeds

No notes for slide

Firebird database that does not burn your data

  1. 1. Firebird a database that does not burn your data
  2. 2. History on one foot <ul><li>Created by Jim Starkey and Ann Harrison at DEC in the 80s with ideas for better user management system in another database (today you know it as Oracle).
  3. 3. Borland bought the database and renamed it to Interbase.
  4. 4. Borland released the source code of Interbase 6.1 at July 2000
  5. 5. Firebird was b u orn </li></ul>http://www.firebirdsql.org/en/historical-reference/
  6. 6. Joining Forks <ul><li>Firebird today is almost the only open source project that uses the Borland's open source code. Most of the other projects, joined to Firebird </li></ul>
  7. 7. So what is Firebird (roughly) ? <ul><li>Open Source licensed full RDBMS
  8. 8. Full ACID support build in
  9. 9. Have nice features : (but does not try to implement everything) </li><ul><li>Triggers, Stored Procedures, Views, Domains, UDF, DDL, TCP Events, Exceptions, User roles
  10. 10. Powerful PSQL
  11. 11. Server(s) based db, Embedded db, Read Only db
  12. 12. Shadow tables
  13. 13. Binding for many programming languages
  14. 14. ...
  15. 15. 3rd party tools and support </li></ul></ul>
  16. 16. How does it tick ? <ul><li>Internal tables that: </li><ul><li>Manage tables
  17. 17. Manage the database itself
  18. 18. Store audit-trails </li></ul></ul>
  19. 19. Tables CREATE TABLE table_name ( column_name {< datatype> | COMPUTED BY (< expr>) | domain } [ DEFAULT { literal | NULL | USER }] [ NOT NULL ] ... CONSTRAINT constraint_name PRIMARY KEY (column_list), UNIQUE (column_list), FOREIGN KEY (column_list) REFERENCES other_table (column_list), CHECK (condition), ... );
  20. 20. Data Types <ul><li>Numeric : </li><ul><li>Smallint
  21. 21. Integer
  22. 22. Float
  23. 23. Double Precision
  24. 24. Decimal
  25. 25. Numeric </li></ul><li>Time and Date : </li><ul><li>Date
  26. 26. Time
  27. 27. Timestamp </li></ul></ul><ul><li>Strings : </li><ul><li>Char
  28. 28. VarChar </li></ul><li>Blobs : </li><ul><li>sub_type text
  29. 29. sub_type binary
  30. 30. sub_type blr
  31. 31. sub_type ...
  32. 32. sub_type <user defined> </li></ul><li>Arrays
  33. 33. User defined domains </li></ul>
  34. 34. +1 <ul><li>No Auto increment directive
  35. 35. Use Triggers and generators (sequence) instead !
  36. 36. It provide more power, and we really do have unique id on all times (unlike some other rdbms'es … [mysql] ) </li></ul>
  37. 37. … Lies, damned lies, and statistics <ul><li>Firebird have statistics regarding the uniqueness of an index: </li><ul><li>Closer to 0, the data is more unique
  38. 38. Closer to 1, the data is less unique </li></ul><li>If the statistics is 0, then each data of the index is unique
  39. 39. If the statistics is 1, then redesign your index please, there is too much repetition of data
  40. 40. Recalculating index: </li></ul>SET STATISTICS INDEX <index name>;
  41. 41. … and they have a plan (?) <ul><li>Firebird also allow you to change how your query will be executed by using plan: </li></ul>SET PLANONLY ON ; SELECT a.emp_no, b.currency FROM employee a INNER JOIN country b ON a.job_country = b.country; PLAN JOIN (A NATURAL ,B INDEX (RDB$PRIMARY1)) SET PLANONLY OFF ;
  42. 42. Questions ? Images copyrights ... <ul><li>Firebird
  43. 43. Fire image
  44. 44. Table
  45. 45. Forks </li></ul>Links: <ul><li>http://www.firebirdsql.org/
  46. 46. http://search.cpan.org/dist/DBD-Firebird/
  47. 47. https://github.com/mariuz/perl-dbd-firebird </li></ul>

×