

-- ------------------------------------------------------
-- This SQL file was generated: 2021-03-16 18:06:32 GMT+0000 (Coordinated Universal Time) based on COD content (0 entries)
-- ------------------------------------------------------


CREATE SCHEMA cod;
DROP TABLE cod.data CASCADE;
CREATE TABLE cod.data (
	file_id INTEGER NOT NULL PRIMARY KEY,
	a REAL NOT NULL,
	b REAL NOT NULL,
	c REAL NOT NULL,
	alpha REAL NOT NULL,
	beta REAL NOT NULL,
	gamma REAL NOT NULL,
	volume REAL NOT NULL,
	formula_str VARCHAR(255) NOT NULL,
	space_group_gid INTEGER NOT NULL,
	centring VARCHAR(1) NOT NULL,
	Elem_C FLOAT,
	Elem_D FLOAT,
	Elem_H FLOAT,
	Elem_N FLOAT,
	Elem_O FLOAT,
	Elem_Cl FLOAT,
	Elem_Br FLOAT,
	Elem_I FLOAT,
	Elem_F FLOAT,
	Elem_S FLOAT,
	Elem_P FLOAT,
	Elem_Ac FLOAT,
	Elem_Ag FLOAT,
	Elem_Al FLOAT,
	Elem_Am FLOAT,
	Elem_Ar FLOAT,
	Elem_As FLOAT,
	Elem_At FLOAT,
	Elem_Au FLOAT,
	Elem_B FLOAT,
	Elem_Ba FLOAT,
	Elem_Be FLOAT,
	Elem_Bi FLOAT,
	Elem_Bk FLOAT,
	Elem_Ca FLOAT,
	Elem_Cd FLOAT,
	Elem_Ce FLOAT,
	Elem_Cf FLOAT,
	Elem_Cm FLOAT,
	Elem_Co FLOAT,
	Elem_Cr FLOAT,
	Elem_Cs FLOAT,
	Elem_Cu FLOAT,
	Elem_Dy FLOAT,
	Elem_Er FLOAT,
	Elem_Eu FLOAT,
	Elem_Fe FLOAT,
	Elem_Fr FLOAT,
	Elem_Ga FLOAT,
	Elem_Gd FLOAT,
	Elem_Ge FLOAT,
	Elem_He FLOAT,
	Elem_Hf FLOAT,
	Elem_Hg FLOAT,
	Elem_Ho FLOAT,
	Elem_In FLOAT,
	Elem_Ir FLOAT,
	Elem_K FLOAT,
	Elem_Kr FLOAT,
	Elem_La FLOAT,
	Elem_Li FLOAT,
	Elem_Lu FLOAT,
	Elem_Mg FLOAT,
	Elem_Mn FLOAT,
	Elem_Mo FLOAT,
	Elem_Na FLOAT,
	Elem_Nb FLOAT,
	Elem_Nd FLOAT,
	Elem_Ne FLOAT,
	Elem_Ni FLOAT,
	Elem_Np FLOAT,
	Elem_Os FLOAT,
	Elem_Pa FLOAT,
	Elem_Pb FLOAT,
	Elem_Pd FLOAT,
	Elem_Pm FLOAT,
	Elem_Po FLOAT,
	Elem_Pr FLOAT,
	Elem_Pt FLOAT,
	Elem_Pu FLOAT,
	Elem_Ra FLOAT,
	Elem_Rb FLOAT,
	Elem_Re FLOAT,
	Elem_Rh FLOAT,
	Elem_Rn FLOAT,
	Elem_Ru FLOAT,
	Elem_Sb FLOAT,
	Elem_Sc FLOAT,
	Elem_Se FLOAT,
	Elem_Si FLOAT,
	Elem_Sm FLOAT,
	Elem_Sn FLOAT,
	Elem_Sr FLOAT,
	Elem_Ta FLOAT,
	Elem_Tb FLOAT,
	Elem_Tc FLOAT,
	Elem_Te FLOAT,
	Elem_Th FLOAT,
	Elem_Ti FLOAT,
	Elem_Tl FLOAT,
	Elem_Tm FLOAT,
	Elem_U FLOAT,
	Elem_V FLOAT,
	Elem_W FLOAT,
	Elem_Xe FLOAT,
	Elem_Y FLOAT,
	Elem_Yb FLOAT,
	Elem_Zn FLOAT,
	Elem_Zr FLOAT
);

CREATE INDEX sum_formula_C_idx ON cod.data(Elem_C);
CREATE INDEX sum_formula_D_idx ON cod.data(Elem_D);
CREATE INDEX sum_formula_H_idx ON cod.data(Elem_H);
CREATE INDEX sum_formula_N_idx ON cod.data(Elem_N);
CREATE INDEX sum_formula_O_idx ON cod.data(Elem_O);
CREATE INDEX sum_formula_Cl_idx ON cod.data(Elem_Cl);
CREATE INDEX sum_formula_Br_idx ON cod.data(Elem_Br);
CREATE INDEX sum_formula_I_idx ON cod.data(Elem_I);
CREATE INDEX sum_formula_F_idx ON cod.data(Elem_F);
CREATE INDEX sum_formula_S_idx ON cod.data(Elem_S);
CREATE INDEX sum_formula_P_idx ON cod.data(Elem_P);
CREATE INDEX sum_formula_Ac_idx ON cod.data(Elem_Ac);
CREATE INDEX sum_formula_Ag_idx ON cod.data(Elem_Ag);
CREATE INDEX sum_formula_Al_idx ON cod.data(Elem_Al);
CREATE INDEX sum_formula_Am_idx ON cod.data(Elem_Am);
CREATE INDEX sum_formula_Ar_idx ON cod.data(Elem_Ar);
CREATE INDEX sum_formula_As_idx ON cod.data(Elem_As);
CREATE INDEX sum_formula_At_idx ON cod.data(Elem_At);
CREATE INDEX sum_formula_Au_idx ON cod.data(Elem_Au);
CREATE INDEX sum_formula_B_idx ON cod.data(Elem_B);
CREATE INDEX sum_formula_Ba_idx ON cod.data(Elem_Ba);
CREATE INDEX sum_formula_Be_idx ON cod.data(Elem_Be);
CREATE INDEX sum_formula_Bi_idx ON cod.data(Elem_Bi);
CREATE INDEX sum_formula_Bk_idx ON cod.data(Elem_Bk);
CREATE INDEX sum_formula_Ca_idx ON cod.data(Elem_Ca);
CREATE INDEX sum_formula_Cd_idx ON cod.data(Elem_Cd);
CREATE INDEX sum_formula_Ce_idx ON cod.data(Elem_Ce);
CREATE INDEX sum_formula_Cf_idx ON cod.data(Elem_Cf);
CREATE INDEX sum_formula_Cm_idx ON cod.data(Elem_Cm);
CREATE INDEX sum_formula_Co_idx ON cod.data(Elem_Co);
CREATE INDEX sum_formula_Cr_idx ON cod.data(Elem_Cr);
CREATE INDEX sum_formula_Cs_idx ON cod.data(Elem_Cs);
CREATE INDEX sum_formula_Cu_idx ON cod.data(Elem_Cu);
CREATE INDEX sum_formula_Dy_idx ON cod.data(Elem_Dy);
CREATE INDEX sum_formula_Er_idx ON cod.data(Elem_Er);
CREATE INDEX sum_formula_Eu_idx ON cod.data(Elem_Eu);
CREATE INDEX sum_formula_Fe_idx ON cod.data(Elem_Fe);
CREATE INDEX sum_formula_Fr_idx ON cod.data(Elem_Fr);
CREATE INDEX sum_formula_Ga_idx ON cod.data(Elem_Ga);
CREATE INDEX sum_formula_Gd_idx ON cod.data(Elem_Gd);
CREATE INDEX sum_formula_Ge_idx ON cod.data(Elem_Ge);
CREATE INDEX sum_formula_He_idx ON cod.data(Elem_He);
CREATE INDEX sum_formula_Hf_idx ON cod.data(Elem_Hf);
CREATE INDEX sum_formula_Hg_idx ON cod.data(Elem_Hg);
CREATE INDEX sum_formula_Ho_idx ON cod.data(Elem_Ho);
CREATE INDEX sum_formula_In_idx ON cod.data(Elem_In);
CREATE INDEX sum_formula_Ir_idx ON cod.data(Elem_Ir);
CREATE INDEX sum_formula_K_idx ON cod.data(Elem_K);
CREATE INDEX sum_formula_Kr_idx ON cod.data(Elem_Kr);
CREATE INDEX sum_formula_La_idx ON cod.data(Elem_La);
CREATE INDEX sum_formula_Li_idx ON cod.data(Elem_Li);
CREATE INDEX sum_formula_Lu_idx ON cod.data(Elem_Lu);
CREATE INDEX sum_formula_Mg_idx ON cod.data(Elem_Mg);
CREATE INDEX sum_formula_Mn_idx ON cod.data(Elem_Mn);
CREATE INDEX sum_formula_Mo_idx ON cod.data(Elem_Mo);
CREATE INDEX sum_formula_Na_idx ON cod.data(Elem_Na);
CREATE INDEX sum_formula_Nb_idx ON cod.data(Elem_Nb);
CREATE INDEX sum_formula_Nd_idx ON cod.data(Elem_Nd);
CREATE INDEX sum_formula_Ne_idx ON cod.data(Elem_Ne);
CREATE INDEX sum_formula_Ni_idx ON cod.data(Elem_Ni);
CREATE INDEX sum_formula_Np_idx ON cod.data(Elem_Np);
CREATE INDEX sum_formula_Os_idx ON cod.data(Elem_Os);
CREATE INDEX sum_formula_Pa_idx ON cod.data(Elem_Pa);
CREATE INDEX sum_formula_Pb_idx ON cod.data(Elem_Pb);
CREATE INDEX sum_formula_Pd_idx ON cod.data(Elem_Pd);
CREATE INDEX sum_formula_Pm_idx ON cod.data(Elem_Pm);
CREATE INDEX sum_formula_Po_idx ON cod.data(Elem_Po);
CREATE INDEX sum_formula_Pr_idx ON cod.data(Elem_Pr);
CREATE INDEX sum_formula_Pt_idx ON cod.data(Elem_Pt);
CREATE INDEX sum_formula_Pu_idx ON cod.data(Elem_Pu);
CREATE INDEX sum_formula_Ra_idx ON cod.data(Elem_Ra);
CREATE INDEX sum_formula_Rb_idx ON cod.data(Elem_Rb);
CREATE INDEX sum_formula_Re_idx ON cod.data(Elem_Re);
CREATE INDEX sum_formula_Rh_idx ON cod.data(Elem_Rh);
CREATE INDEX sum_formula_Rn_idx ON cod.data(Elem_Rn);
CREATE INDEX sum_formula_Ru_idx ON cod.data(Elem_Ru);
CREATE INDEX sum_formula_Sb_idx ON cod.data(Elem_Sb);
CREATE INDEX sum_formula_Sc_idx ON cod.data(Elem_Sc);
CREATE INDEX sum_formula_Se_idx ON cod.data(Elem_Se);
CREATE INDEX sum_formula_Si_idx ON cod.data(Elem_Si);
CREATE INDEX sum_formula_Sm_idx ON cod.data(Elem_Sm);
CREATE INDEX sum_formula_Sn_idx ON cod.data(Elem_Sn);
CREATE INDEX sum_formula_Sr_idx ON cod.data(Elem_Sr);
CREATE INDEX sum_formula_Ta_idx ON cod.data(Elem_Ta);
CREATE INDEX sum_formula_Tb_idx ON cod.data(Elem_Tb);
CREATE INDEX sum_formula_Tc_idx ON cod.data(Elem_Tc);
CREATE INDEX sum_formula_Te_idx ON cod.data(Elem_Te);
CREATE INDEX sum_formula_Th_idx ON cod.data(Elem_Th);
CREATE INDEX sum_formula_Ti_idx ON cod.data(Elem_Ti);
CREATE INDEX sum_formula_Tl_idx ON cod.data(Elem_Tl);
CREATE INDEX sum_formula_Tm_idx ON cod.data(Elem_Tm);
CREATE INDEX sum_formula_U_idx ON cod.data(Elem_U);
CREATE INDEX sum_formula_V_idx ON cod.data(Elem_V);
CREATE INDEX sum_formula_W_idx ON cod.data(Elem_W);
CREATE INDEX sum_formula_Xe_idx ON cod.data(Elem_Xe);
CREATE INDEX sum_formula_Y_idx ON cod.data(Elem_Y);
CREATE INDEX sum_formula_Yb_idx ON cod.data(Elem_Yb);
CREATE INDEX sum_formula_Zn_idx ON cod.data(Elem_Zn);
CREATE INDEX sum_formula_Zr_idx ON cod.data(Elem_Zr);

CREATE INDEX data_a_idx ON cod.data(a);
CREATE INDEX data_b_idx ON cod.data(b);
CREATE INDEX data_c_idx ON cod.data(c);
CREATE INDEX data_alpha_idx ON cod.data(alpha);
CREATE INDEX data_beta_idx ON cod.data(beta);
CREATE INDEX data_gamma_idx ON cod.data(gamma);
CREATE INDEX data_volume_idx ON cod.data(volume);
CREATE INDEX data_space_group_gid_idx ON cod.data(space_group_gid);
CREATE INDEX data_centring ON cod.data(centring);
