GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
Digital_Repository
Browse code
- Added an index on view.archiveid.
master
1 parent
5fbee04
commit
4f3a8c515ba471c45ce1780c4d400a3524220a4b
nstanger
authored
on 29 Apr 2009
Patch
Showing
1 changed file
Repositories/statistics/sql/db.schema.eprintstats.sql
Ignore Space
Show notes
View
Repositories/statistics/sql/db.schema.eprintstats.sql
-- -- mysql -u root -p < db.schema.eprintstats.sql -- /* * Load schema for eprintstats project. * */ drop database if exists eprintstats; create database eprintstats; use eprintstats; /* See end for permissions statements */ DROP TABLE IF EXISTS view; CREATE TABLE view ( id int(10) unsigned NOT NULL auto_increment, uniquebits varchar(200) , /* UNIQUE? to avoid multiple inputs */ archive_name varchar(50) NOT NULL, /* mysql archive name unimelb,alia etc */ ip varchar(100) NOT NULL, /* ip of request */ request_date date NOT NULL, archiveid int(10) NOT NULL, /* Id of requested archive */ country_code varchar(4), /* 2 letter iso3166 country code */ country_name varchar(100), /* Country name iso3166 */ view_type ENUM("abstract","download"), eprint_name varchar(200), PRIMARY KEY (id) ) TYPE=MyISAM; DROP TABLE IF EXISTS lastproc; CREATE TABLE lastproc ( id int(10) unsigned NOT NULL auto_increment, timeinsert timestamp, lastproc varchar(100), PRIMARY KEY (id) ) TYPE=MyISAM; /* Add db user and password. */ /* make sure the user/pass matches the inc.vars.es.php file and the 2 scripts in the scripts directory. */ grant all on eprintstats.* to eprintstatspriv identified by 'AuldGrizzel'; grant select on eprintstats.* to eprintstatspub identified by 'AuldGrizzel'; flush privileges; /* NJS 2009-04-29 Add indexes to improve query performance. These may become an issue if hit rates are very high (=> many INSERTs). */ -- This seems to be the most effective (greatest impact). create index archiveid_idx on view ( archiveid );
-- -- mysql -u root -p < db.schema.eprintstats.sql -- /* * Load schema for eprintstats project. * */ drop database if exists eprintstats; create database eprintstats; use eprintstats; /* See end for permissions statements */ DROP TABLE IF EXISTS view; CREATE TABLE view ( id int(10) unsigned NOT NULL auto_increment, uniquebits varchar(200) , /* UNIQUE? to avoid multiple inputs */ archive_name varchar(50) NOT NULL, /* mysql archive name unimelb,alia etc */ ip varchar(100) NOT NULL, /* ip of request */ request_date date NOT NULL, archiveid int(10) NOT NULL, /* Id of requested archive */ country_code varchar(4), /* 2 letter iso3166 country code */ country_name varchar(100), /* Country name iso3166 */ view_type ENUM("abstract","download"), eprint_name varchar(200), PRIMARY KEY (id) ) TYPE=MyISAM; DROP TABLE IF EXISTS lastproc; CREATE TABLE lastproc ( id int(10) unsigned NOT NULL auto_increment, timeinsert timestamp, lastproc varchar(100), PRIMARY KEY (id) ) TYPE=MyISAM; /* Add db user and password. */ /* make sure the user/pass matches the inc.vars.es.php file and the 2 scripts in the scripts directory. */ grant all on eprintstats.* to eprintstatspriv identified by 'AuldGrizzel'; grant select on eprintstats.* to eprintstatspub identified by 'AuldGrizzel'; flush privileges;
Show line notes below