/*! @page schema Schemas The tables we have seen so far have all had simple key/value pairs for records. We now explain how to deal with more complex data in WiredTiger. @section schema_intro Tables, Rows and Columns A table is a logical representation of data consisting of cells in rows and columns. For example, a database might have this table.
EmpId | Lastname | Firstname | Salary |
---|---|---|---|
1 | Smith | Joe | 40000 |
2 | Jones | Mary | 50000 |
3 | Johnson | Cathy | 44000 |
1,Smith,Joe,40000; 2,Jones,Mary,50000; 3,Johnson,Cathy,44000;A column-oriented database stores all of the values of a column together, then the values of the next column, and so on:
1,2,3; Smith,Jones,Johnson; Joe,Mary,Cathy; 40000,50000,44000;WiredTiger supports both storage formats, and can mix and match the storage of columns within a logical table. Applications describe the format of their data by supplying a schema to WT_SESSION::create. This specifies how the application's data can be split into fields and mapped onto rows and columns. @section schema_types Column types @todo describe types See @ref packing for a complete list of types. @section schema_data_access Columns in key and values @todo Describe how to use WT_CURSOR::get_key, WT_CURSOR::get_value, WT_CURSOR::set_key and WT_CURSOR::set_value to access columns. @section schema_columns Describing Columns @todo describe how to add columns to a schema @section schema_column_groups Storing Groups of Columns Together @todo define and describe column groups @section schema_indices Adding an Index @todo describe how to add indices to a schema @section schema_mapping Column Storage @todo describe how to store some columns separately @section schema_examples Code Samples The code below is taken from the complete example program @ex_ref{ex_schema.c}. @dontinclude ex_schema.c @skip C struct @until POP_RECORD @skip open_session @until conn->close The code below is taken from the complete example program @ex_ref{ex_call_center.c}. @dontinclude ex_call_center.c @skip home @until CALL @skip create @until conn->close @section schema_advanced Advanced Schemas - non-relational data such as multiple index keys per row - application-supplied extractors and collators may need to be registered before recovery can run. */