So I want to save different URIs in database.
I want format to be forced as well to look up different URIs easily.
Is it better to create table like this:
CREATE TABLE uris ( id INT(11) UNIQUE PRIMARY KEY AUTO_INCREMENT, scheme VARCHAR(255) NOT NULL, host VARCHAR(255) NOT NULL, path VARCHAR(255) NOT NULL, port SMALLINT UNSIGNED, query VARCHAR(255), fragment VARCHAR(255) ); Or just
CREATE TABLE uris ( id INT(11) UNSIGNED PRIMARY KEY AUTO_INCREMENT, uri TEXT NOT NULL ); UPDATE: Use
Read, store maybe do some analytics. Build back original URI and if it's web URL redirect. May do some searching that's why I think first is better.
I am more interested in what advantage does one have over another or are there any problems in using one of them ?