Alex Rivera | Logout

Databases: Are "TEXT" fields less efficient than "varchar"?

Asked 2008-10-16T09:06:10.687
10

Is it less efficient to use TEXT than varchar in an SQL database?

If so why?

If not why would you not just always use TEXT?

I'm not targetting a specific database here but oracle is probably the most relevant, although I'm testing on MySQL for the time being as part of a proof of concept.

Edit
Report

1 Answer

3

PostgreSQL documentation says:

Tip: There are no performance differences between these three types, apart from increased storage size when using the blank-padded type, and a few extra cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, it has no such advantages in PostgreSQL. In most situations text or character varying should be used instead.

answered 2008-10-16T12:06:07.627

Your Answer