This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DROP TABLE IF EXISTS time_dimension; | |
| CREATE TABLE time_dimension ( | |
| id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
| db_date DATE NOT NULL, | |
| year INTEGER NOT NULL, | |
| month INTEGER NOT NULL, -- 1 to 12 | |
| day INTEGER NOT NULL, -- 1 to 31 | |
| quarter INTEGER NOT NULL, -- 1 to 4 | |
| week INTEGER NOT NULL, -- 1 to 52/53 | |
| day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SET lc_time_names = 'es_ES'; | |
| DROP TABLE IF EXISTS time_dimension; | |
| CREATE TABLE time_dimension ( | |
| id INTEGER PRIMARY KEY, -- year*10000+month*100+day | |
| db_date DATE NOT NULL, | |
| year INTEGER NOT NULL, | |
| month INTEGER NOT NULL, -- 1 to 12 | |
| day INTEGER NOT NULL, -- 1 to 31 | |
| quarter INTEGER NOT NULL, -- 1 to 4 | |
| week INTEGER NOT NULL, -- 1 to 52/53 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT (PagesData*PageSize)/POWER(1024,3) DataGB FROM | |
| (SELECT variable_value PagesData | |
| FROM information_schema.global_status | |
| WHERE variable_name='Innodb_buffer_pool_pages_data') A, | |
| (SELECT variable_value PageSize | |
| FROM information_schema.global_status | |
| WHERE variable_name='Innodb_page_size') B; |