Re: primary keys as TEXT

From: Manlio Perillo <manlio_perillo(at)libero(dot)it>
To: Aaron Bono <postgresql(at)aranya(dot)com>
Cc: Michael Glaesemann <grzm(at)seespotcode(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: primary keys as TEXT
Date: 2006-07-31 08:57:43
Message-ID: 44CDC607.6080006@libero.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Aaron Bono ha scritto:
> On 7/28/06, *Manlio Perillo* <manlio_perillo(at)libero(dot)it
> <mailto:manlio_perillo(at)libero(dot)it>> wrote:
>
> Michael Glaesemann ha scritto:
> >
> > On Jul 28, 2006, at 17:37 , Manlio Perillo wrote:
> >
> >> There can be performancs problems in having primary keys of type
> TEXT?
> >> What about having a primary key of 3 columns (all of type TEXT)?
> >
> > What defines a problem in terms of performance is heavily dependent on
> > your particular needs and requirements. What are your
> requirements? What
> > profiling have you done to see where your performance bottlenecks
> may be?
> >
>
> I still don't have done profiling.
>
> Simply in the first version of my schema I used serial keys but the
> result is ugly and it force me to do a lot of joins.
>
>
>
> Ugly? Not sure what you mean by that.
>

Because serial ids are only surrogate keys.
My tables have well definited primary keys, the only problem is that
they are of type TEXT (and spawn up to 3 columns).

My concern is: how bad can be performance?

> I do understand the problem with so many joins. I use views so that the
> joins are only delt with once (in the database) and then all my
> applications run off the views. That way, the applications use very
> simple queries. The views also allow me to change the table structure
> (column names, more table normalization, etc.) without having to make
> changes to the application.
>

View are a good idea, thanks.

Regards Manlio Perillo

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mathieu Arnold 2006-07-31 11:56:18 Re: DBD::Pg ... how would I format this prepare?
Previous Message Aaron Bono 2006-07-31 08:12:29 Re: Joining a result set from four (4) tables