Re: Fixed width rows faster?

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: Fixed width rows faster?
Дата
Msg-id 4049A16E.1040606@familyhealth.com.au
обсуждение исходный текст
Ответ на Re: Fixed width rows faster?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
> If you have an actual business-logic requirement to restrict a field to
> no more than N characters, then by all means use varchar(N); that's
> what it's for.  But I agree with what I think Josh meant: there is very
> seldom any non-broken reason to have a hard upper limit on string
> lengths.  If you think you need varchar(N) you should stop and ask
> why exactly.  If you cannot give a specific, coherent reason why the
> particular value of N that you're using is the One True Length for the
> field, then you really need to think twice.

One nice reason to have like VARCHAR(4096) or whatever is that if there
is a bug in your website and you forget to length check some user input,
it stops them from screwing you by uploading megs and megs of data into
a 'firstname' field, say.

Chris


В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Fixed width rows faster?
Следующее
От: "Eric Jain"
Дата:
Сообщение: Re: Fixed width rows faster?