[Python] Applicazione WEB con Python e Postgresql

Carlos Catucci carlos.catucci a gmail.com
Mar 23 Set 2014 19:19:25 CEST


2014-09-23 17:32 GMT+02:00 Marco Fochesato <marcofoc a gmail.com>:
>
> Va bene!
> Si infatti, per "sentirmi stretto", parlavo di quello: perchč deve
esserci per forza na colonna id??

1 - It's faster. A JOIN on an integer is much quicker than a JOIN on a
string field or combination of fields. It's more efficient to compare
integers than strings.

2 - It's simpler. It's much easier to map relations based on a single
numeric field than on a combination of other fields of varying data types.

3 - It's data-independent. If you match on the ID you don't need to worry
about the relation changing. If you match on a name, what do you do if
their name changes (i.e. marriage)? If you match on an address, what if
someone moves?

4 - It's more efficient If you cluster on an (auto incrementing) int field,
you reduce fragmentation and reduce overall size of the data set. This also
simplifies indexes needed to cover your relations.

> Poi, io la programmazione ad oggetti non l'ho ancora digerita. Vado
ancora a funzioni.
> So che č come andare in Ferrari usando solo la prima marcia... lo sento.
Ma non l'ho ancora imparato.
> O meglio, non ne ho avuto ancora l'esigenza...

L'esigenza potresi non averla mai. Se non sai cosa sia e quanto sia
potente. E' come dire: non sento l'esigenza di provare la lasagna. ;)

> Credo che inizierņ proprio qui.
> E credo anche che vi romperņ spesso le scatole.

Fai pure


Carlos
--
EZLN ... Para Todos Todo ...
-------------- parte successiva --------------
Un allegato HTML č stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20140923/bda70de7/attachment.html>


Maggiori informazioni sulla lista Python