Re: CHAR or VARCHAR
От | Peter J. Schoenster |
---|---|
Тема | Re: CHAR or VARCHAR |
Дата | |
Msg-id | 3AB8EE97.16683.AF4807A@localhost обсуждение исходный текст |
Ответ на | CHAR or VARCHAR ("Martin A. Marques" <martin@math.unl.edu.ar>) |
Список | pgsql-sql |
On 21 Mar 2001, at 18:58, Martin A. Marques wrote: > two questions. > When should I use one, and when the other? > Which is the limit on CHAR(n) and VARCHAR(n)? Okay, here is my more "let's get this thing working" as opposed to "after dedicated study of the matter" opinion (which I hope some dedicated studier might correct or confirm or extend) (and, ps, I do 99% of dev on mysql): I live under the assumption that indexes on CHAR will be "faster" but that CHAR may vary well consume more disk space as I believe it pads data to fit the size you created for it. This page does not help much: http://www.postgresql.org/docs/user/datatype1066.htm This page is interesting: http://www.postgresql.org/docs/user/sql-createindex.htm > Tip: Indexes are primarily used to enhance database performance. But > inappropriate use will result in slower performance. I rarely index a table if there are many inserts/updates. So char vs. varchar .... Peter --------------------------- "Reality is that which, when you stop believing in it, doesn't go away". -- Philip K. Dick
В списке pgsql-sql по дате отправления: