Quantcast
Viewing latest article 2
Browse Latest Browse All 12

Answer by Flavio Tordini for Best database field type for a URL

You should use a VARCHAR with an ASCII character encoding. URLs are percent encoded and international domain names use punycode so ASCII is enough to store them. This will use much less space than UTF8.

VARCHAR(512) CHARACTER SET 'ascii' COLLATE 'ascii_general_ci' NOT NULL

Viewing latest article 2
Browse Latest Browse All 12

Trending Articles