Re: Data type to use for primary key

Поиск
Список
Период
Сортировка
Искать
От
Pierre-Frédéric Caillaud
Тема
Re: Data type to use for primary key
Дата
Msg-id
opshv2gng3cq72hf@musicbox
Ответ на
Список
Дерево обсуждения
Data type to use for primary key Alexandre Leclerc <alexandre.leclerc@gmail.com>
Re: Data type to use for primary key Josh Berkus <josh@agliodbs.com>
Re: Data type to use for primary key Rod Taylor <pg@rbt.ca>
Re: Data type to use for primary key Josh Berkus <josh@agliodbs.com>
Re: Data type to use for primary key Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>
Re: Data type to use for primary key Alexandre Leclerc <alexandre.leclerc@gmail.com>
Re: Data type to use for primary key Greg Stark <gsstark@mit.edu>
Re: Data type to use for primary key Alexandre Leclerc <alexandre.leclerc@gmail.com>
Re: Data type to use for primary key Tom Lane <tgl@sss.pgh.pa.us>
Re: Data type to use for primary key Greg Stark <gsstark@mit.edu>
Re: Data type to use for primary key Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>
Re: Data type to use for primary key Alexandre Leclerc <alexandre.leclerc@gmail.com>
Re: Data type to use for primary key "Peter Darley" <pdarley@kinesis-cem.com>
Re: Data type to use for primary key Pierre-Frédéric Caillaud<lists@boutiquenumerique.com>

> What is the common approach? Should I use directly the product_code as
> my ID, or use a sequantial number for speed? (I did the same for the
> company_id, this is a 'serial' and not the shor name of the customer.
> I just don't know what is usually done.

	Use a serial :
	- you can change product_code for a product easily
	- you can pass around integers easier around, in web forms for instance,  
you don't have to ask 'should I escape this string ?'
	- it's faster
	- it uses less space
	- if one day you must manage products from another source whose  
product_code overlap yours, you won't have problems
	- you can generate them with a serial uniquely and easily
В списке pgsql-performance по дате отправления
От: Merlin Moncure
Дата:
Сообщение: scalability issues on win32
От: Pierre-Frédéric Caillaud
Дата:
FAQ