Re: primary keys as TEXT

From: "Aaron Bono" <postgresql(at)aranya(dot)com>
To: "Manlio Perillo" <manlio_perillo(at)libero(dot)it>
Cc: "Michael Glaesemann" <grzm(at)seespotcode(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: primary keys as TEXT
Date: 2006-07-30 20:28:54
Message-ID: bf05e51c0607301328n112e57bfxf0d6e7e7dada2b7d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 7/28/06, Manlio Perillo <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.

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.

I am even getting ready to start using updatable views so my applications
never touch the tables directly - it ads another layer of abstraction
between the tables and the application. But that may be more complicated
than you are ready for - I have yet to decide if it will be worth the effort
but I won't know until I experiment with it more.

==================================================================
Aaron Bono
Aranya Software Technologies, Inc.
http://www.aranya.com
==================================================================

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Thusitha Kodikara 2006-07-31 04:16:44 Triggers using PL/pgSQL
Previous Message Fabian Peters 2006-07-29 08:38:58 Re: [SOLVED] UPDATE with WHERE clause on joined table