github.com/dolthub/go-mysql-server@v0.18.0/enginetest/scriptgen/setup/scripts/imdb (about)

     1  exec
     2  CREATE TABLE aka_name (
     3      id integer NOT NULL PRIMARY KEY,
     4      person_id integer NOT NULL,
     5      name text NOT NULL,
     6      imdb_index character varying(12),
     7      name_pcode_cf character varying(5),
     8      name_pcode_nf character varying(5),
     9      surname_pcode character varying(5),
    10      md5sum character varying(32)
    11  );
    12  ----
    13  
    14  exec
    15  CREATE TABLE aka_title (
    16      id integer NOT NULL PRIMARY KEY,
    17      movie_id integer NOT NULL,
    18      title text NOT NULL,
    19      imdb_index character varying(12),
    20      kind_id integer NOT NULL,
    21      production_year integer,
    22      phonetic_code character varying(5),
    23      episode_of_id integer,
    24      season_nr integer,
    25      episode_nr integer,
    26      note text,
    27      md5sum character varying(32)
    28  );
    29  ----
    30  
    31  exec
    32  CREATE TABLE cast_info (
    33      id integer NOT NULL PRIMARY KEY,
    34      person_id integer NOT NULL,
    35      movie_id integer NOT NULL,
    36      person_role_id integer,
    37      note text,
    38      nr_order integer,
    39      role_id integer NOT NULL
    40  );
    41  ----
    42  
    43  exec
    44  CREATE TABLE char_name (
    45      id integer NOT NULL PRIMARY KEY,
    46      name text NOT NULL,
    47      imdb_index character varying(12),
    48      imdb_id integer,
    49      name_pcode_nf character varying(5),
    50      surname_pcode character varying(5),
    51      md5sum character varying(32)
    52  );
    53  ----
    54  
    55  exec
    56  CREATE TABLE comp_cast_type (
    57      id integer NOT NULL PRIMARY KEY,
    58      kind character varying(32) NOT NULL
    59  );
    60  ----
    61  
    62  exec
    63  CREATE TABLE company_name (
    64      id integer NOT NULL PRIMARY KEY,
    65      name text NOT NULL,
    66      country_code character varying(255),
    67      imdb_id integer,
    68      name_pcode_nf character varying(5),
    69      name_pcode_sf character varying(5),
    70      md5sum character varying(32)
    71  );
    72  ----
    73  
    74  exec
    75  CREATE TABLE company_type (
    76      id integer NOT NULL PRIMARY KEY,
    77      kind character varying(32) NOT NULL
    78  );
    79  ----
    80  
    81  exec
    82  CREATE TABLE complete_cast (
    83      id integer NOT NULL PRIMARY KEY,
    84      movie_id integer,
    85      subject_id integer NOT NULL,
    86      status_id integer NOT NULL
    87  );
    88  ----
    89  
    90  exec
    91  CREATE TABLE info_type (
    92      id integer NOT NULL PRIMARY KEY,
    93      info character varying(32) NOT NULL
    94  );
    95  ----
    96  
    97  exec
    98  CREATE TABLE keyword (
    99      id integer NOT NULL PRIMARY KEY,
   100      keyword text NOT NULL,
   101      phonetic_code character varying(5)
   102  );
   103  ----
   104  
   105  exec
   106  CREATE TABLE kind_type (
   107      id integer NOT NULL PRIMARY KEY,
   108      kind character varying(15) NOT NULL
   109  );
   110  ----
   111  
   112  exec
   113  CREATE TABLE link_type (
   114      id integer NOT NULL PRIMARY KEY,
   115      link character varying(32) NOT NULL
   116  );
   117  ----
   118  
   119  exec
   120  CREATE TABLE movie_companies (
   121      id integer NOT NULL PRIMARY KEY,
   122      movie_id integer NOT NULL,
   123      company_id integer NOT NULL,
   124      company_type_id integer NOT NULL,
   125      note text
   126  );
   127  ----
   128  
   129  exec
   130  CREATE TABLE movie_info (
   131      id integer NOT NULL PRIMARY KEY,
   132      movie_id integer NOT NULL,
   133      info_type_id integer NOT NULL,
   134      info text NOT NULL,
   135      note text
   136  );
   137  ----
   138  
   139  exec
   140  CREATE TABLE movie_info_idx (
   141      id integer NOT NULL PRIMARY KEY,
   142      movie_id integer NOT NULL,
   143      info_type_id integer NOT NULL,
   144      info text NOT NULL,
   145      note text
   146  );
   147  ----
   148  
   149  exec
   150  CREATE TABLE movie_keyword (
   151      id integer NOT NULL PRIMARY KEY,
   152      movie_id integer NOT NULL,
   153      keyword_id integer NOT NULL
   154  );
   155  ----
   156  
   157  exec
   158  CREATE TABLE movie_link (
   159      id integer NOT NULL PRIMARY KEY,
   160      movie_id integer NOT NULL,
   161      linked_movie_id integer NOT NULL,
   162      link_type_id integer NOT NULL
   163  );
   164  ----
   165  
   166  exec
   167  CREATE TABLE name (
   168      id integer NOT NULL PRIMARY KEY,
   169      name text NOT NULL,
   170      imdb_index character varying(12),
   171      imdb_id integer,
   172      gender character varying(1),
   173      name_pcode_cf character varying(5),
   174      name_pcode_nf character varying(5),
   175      surname_pcode character varying(5),
   176      md5sum character varying(32)
   177  );
   178  ----
   179  
   180  exec
   181  CREATE TABLE person_info (
   182      id integer NOT NULL PRIMARY KEY,
   183      person_id integer NOT NULL,
   184      info_type_id integer NOT NULL,
   185      info text NOT NULL,
   186      note text
   187  );
   188  ----
   189  
   190  exec
   191  CREATE TABLE role_type (
   192      id integer NOT NULL PRIMARY KEY,
   193      role character varying(32) NOT NULL
   194  );
   195  ----
   196  
   197  exec
   198  CREATE TABLE title (
   199      id integer NOT NULL PRIMARY KEY,
   200      title text NOT NULL,
   201      imdb_index character varying(12),
   202      kind_id integer NOT NULL,
   203      production_year integer,
   204      imdb_id integer,
   205      phonetic_code character varying(5),
   206      episode_of_id integer,
   207      season_nr integer,
   208      episode_nr integer,
   209      series_years character varying(49),
   210      md5sum character varying(32)
   211  );
   212  ----
   213  
   214  exec
   215  create index company_id_movie_companies on movie_companies(company_id);
   216  ----
   217  
   218  exec
   219  create index company_type_id_movie_companies on movie_companies(company_type_id);
   220  ----
   221  
   222  exec
   223  create index info_type_id_movie_info_idx on movie_info_idx(info_type_id);
   224  ----
   225  
   226  exec
   227  create index info_type_id_movie_info on movie_info(info_type_id);
   228  ----
   229  
   230  exec
   231  create index info_type_id_person_info on person_info(info_type_id);
   232  ----
   233  
   234  exec
   235  create index keyword_id_movie_keyword on movie_keyword(keyword_id);
   236  ----
   237  
   238  exec
   239  create index kind_id_aka_title on aka_title(kind_id);
   240  ----
   241  
   242  exec
   243  create index kind_id_title on title(kind_id);
   244  ----
   245  
   246  exec
   247  create index linked_movie_id_movie_link on movie_link(linked_movie_id);
   248  ----
   249  
   250  exec
   251  create index link_type_id_movie_link on movie_link(link_type_id);
   252  ----
   253  
   254  exec
   255  create index movie_id_aka_title on aka_title(movie_id);
   256  ----
   257  
   258  exec
   259  create index movie_id_cast_info on cast_info(movie_id);
   260  ----
   261  
   262  exec
   263  create index movie_id_complete_cast on complete_cast(movie_id);
   264  ----
   265  
   266  exec
   267  create index movie_id_movie_companies on movie_companies(movie_id);
   268  ----
   269  
   270  exec
   271  create index movie_id_movie_info_idx on movie_info_idx(movie_id);
   272  ----
   273  
   274  exec
   275  create index movie_id_movie_keyword on movie_keyword(movie_id);
   276  ----
   277  
   278  exec
   279  create index movie_id_movie_link on movie_link(movie_id);
   280  ----
   281  
   282  exec
   283  create index movie_id_movie_info on movie_info(movie_id);
   284  ----
   285  
   286  exec
   287  create index person_id_aka_name on aka_name(person_id);
   288  ----
   289  
   290  exec
   291  create index person_id_cast_info on cast_info(person_id);
   292  ----
   293  
   294  exec
   295  create index person_id_person_info on person_info(person_id);
   296  ----
   297  
   298  exec
   299  create index person_role_id_cast_info on cast_info(person_role_id);
   300  ----
   301  
   302  exec
   303  create index role_id_cast_info on cast_info(role_id);
   304  ----
   305  
   306  exec
   307  analyze table aka_name update histogram on id using data '{"row_count": 900662}';
   308  ----
   309  exec
   310  analyze table aka_title update histogram on id using data '{"row_count": 361376}';
   311  ----
   312  exec
   313  analyze table cast_info update histogram on id using data '{"row_count": 36124530}';
   314  ----
   315  exec
   316  analyze table char_name update histogram on id using data '{"row_count": 3136382}';
   317  ----
   318  exec
   319  analyze table company_name update histogram on id using data '{"row_count": 234825}';
   320  ----
   321  exec
   322  analyze table company_type update histogram on id using data '{"row_count": 4}';
   323  ----
   324  exec
   325  analyze table complete_cast update histogram on id using data '{"row_count": 135086}';
   326  ----
   327  exec
   328  analyze table comp_cast_type update histogram on id using data '{"row_count": 4}';
   329  ----
   330  exec
   331  analyze table info_type update histogram on id using data '{"row_count": 113}';
   332  ----
   333  exec
   334  analyze table keyword update histogram on id using data '{"row_count": 134110}';
   335  ----
   336  exec
   337  analyze table kind_type update histogram on id using data '{"row_count": 7}';
   338  ----
   339  exec
   340  analyze table link_type update histogram on id using data '{"row_count": 18}';
   341  ----
   342  exec
   343  analyze table movie_companies update histogram on id using data '{"row_count": 2604067}';
   344  ----
   345  exec
   346  analyze table movie_info update histogram on id using data '{"row_count": 14355706}';
   347  ----
   348  exec
   349  analyze table movie_info_idx update histogram on id using data '{"row_count": 1380035}';
   350  ----
   351  exec
   352  analyze table movie_keyword update histogram on id using data '{"row_count": 4523930}';
   353  ----
   354  exec
   355  analyze table movie_link update histogram on id using data '{"row_count": 29997}';
   356  ----
   357  exec
   358  analyze table name update histogram on id using data '{"row_count": 4167453}';
   359  ----
   360  exec
   361  analyze table person_info update histogram on id using data '{"row_count": 2024951}';
   362  ----
   363  exec
   364  analyze table row_type update histogram on id using data '{"row_count": 12}';
   365  ----
   366  analyze table title update histogram on id using data '{"row_count": 2527799}';
   367  ----