DROP TABLE dict;
DROP TABLE url;
DROP TABLE stopword;
DROP TABLE robots;

CREATE TABLE dict (
  url_id INT NOT NULL,
  word CHAR(32) NOT NULL,
  intag INT NOT NULL
);

CREATE TABLE url (
  rec_id INT NOT NULL IDENTITY,
  status INT,
  url CHAR(128) NOT NULL,
  content_type CHAR(48),
  title CHAR(128),
  txt CHAR(255),
  docsize INT,
  next_index_time INT NOT NULL,
  last_mod_time INT,
  referrer INT,
  tag CHAR(16),
  hops INT,
  category CHAR(16),
  keywords CHAR(255),
  description CHAR(100),
  crc32 INT NOT NULL,
  lang CHAR(32) DEFAULT '' NOT NULL,
  charset CHAR(40) DEFAULT '' NOT NULL,
  seed INT
);

CREATE TABLE stopword (
  word char(32) DEFAULT '' NOT NULL,
  lang char(32) DEFAULT '' NOT NULL
);

CREATE TABLE robots (
  hostinfo CHAR(127) NOT NULL,
  path CHAR(127) NOT NULL
);

CREATE   INDEX dict_word ON dict (word);

CREATE   INDEX dict_url_id ON dict (url_id);

CREATE UNIQUE  INDEX url_url ON url (url);

CREATE INDEX url_crc ON url (crc32);

CREATE INDEX url_seed ON url (seed);

CREATE UNIQUE  INDEX stopword_word ON stopword (word,lang);

