DROP TABLE dict \g
DROP TABLE url \g
DROP TABLE stopword \g
DROP TABLE robots \g


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

CREATE   INDEX dict_word_url_id ON dict (
	word,
	url_id
) \g

CREATE   INDEX dict_url_id ON dict (
	url_id
) \g

CREATE TABLE url (
  rec_id INT NOT NULL,
  status INT,
  url CHAR(128) NOT NULL,
  content_type CHAR(48),
  title CHAR(128),
  txt CHAR(255),
  docsize INT,
  last_index_time UINT NOT NULL,
  next_index_time UINT NOT NULL,
  last_mod_time UINT,
  referrer INT,
  tag CHAR(10),
  hops INT,
  category CHAR(10),
  keywords CHAR(255),
  description CHAR(100),
  crc32 INT,
  lang CHAR(2)
) \g


CREATE UNIQUE  INDEX url_url_id ON url (
	rec_id
) \g

CREATE UNIQUE  INDEX url_url ON url (
	url
) \g

CREATE   INDEX url_crc ON url (
	crc32
) \g

CREATE SEQUENCE ON url STEP 1 VALUE 11 \g

CREATE TABLE stopword (
  word char(32)  NOT NULL,
  lang char(2)   NOT NULL
) \g

CREATE UNIQUE  INDEX stopword ON stopword (
	word , lang
) \g


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

