Re: Difference between varchar and text?
От | Abel Abraham Camarillo Ojeda |
---|---|
Тема | Re: Difference between varchar and text? |
Дата | |
Msg-id | CAPD=2Nj=1uvC0bnK7TWFVym-U3n4n--X6Jamv9o6t4Kp4Jt1wA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Difference between varchar and text? (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Difference between varchar and text?
|
Список | pgsql-general |
On Sun, Nov 18, 2012 at 1:29 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > David Johnston <polobo@yahoo.com> writes: >> On Nov 17, 2012, at 20:43, John R Pierce <pierce@hogranch.com> wrote: >>> I think he meant a tiny tiny bit faster, primarily due to not having to validate the length. > >> Maybe... But I would presume a "varchar with no limit" does not validate length... > > There is overhead from the type system for varchar, whether or not it > has a length limit --- you'll get at least some RelabelType nodes in > expression trees, and those don't have zero cost to execute. > > I'd generally recommend using "text" if you don't have any interest in > enforcing a specific length limit. > > regards, tom lane > > > -- > Sent via pgsql-general mailing list (pgsql-general@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general As far as I know varchar(n) with n being less or equal than 126 cannot be toasted, and have only one octet of overhead. http://www.postgresql.org/docs/9.2/static/storage-toast.html
В списке pgsql-general по дате отправления: