Datatypes and performance

Поиск
Список
Период
Сортировка
От Jay O'Connor
Тема Datatypes and performance
Дата
Msg-id 20030704091041.C1100@altaica
обсуждение исходный текст
Ответы Re: Datatypes and performance  (Shridhar Daithankar <shridhar_daithankar@persistent.co.in>)
Re: Datatypes and performance  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Re: Datatypes and performance  (Andrew Sullivan <andrew@libertyrms.info>)
Список pgsql-general
Couple of questions on datat types and performance

1. varchar vs varchar(2)

I created a database schema and based on the test data I had to work with,
I couldn't really determine the max size of a lot of string fields so I
just left a lot of fields as varchar

A comment from a coworker was that this would cause a performance problem

Based on the docs, they say that there's not performance difference between
using varchar(n) and text.

So will leaving my fields as unlimited varchar be a performance issue?  Or
should I try to narrow them down?

My coworker has more experience with Oracle and MS-SQL than postgresql

2.varchar and int
I was using a varchar as one field that's part of an index.  Looking at the
data, I realized I could just use an int instead.  My assumption would be
that an int would be faster to serach for thena  varchar, so I converted
the field to int.  Is this a valid assumption?

Thanks

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: any body using Solaris8 with postgresql 7.3.3
Следующее
От: Shridhar Daithankar
Дата:
Сообщение: Re: Datatypes and performance