Received: from shire.ontko.com (shire.ontko.com [199.164.165.1]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAUCKEm83324 for ; Fri, 30 Nov 2001 07:20:14 -0500 (EST) (envelope-from nickf@ontko.com) Received: from nick (bilbo.ontko.com [199.164.165.101]) by shire.ontko.com (8.9.3/8.9.3/Debian 8.9.3-21) with SMTP id HAA14368; Fri, 30 Nov 2001 07:20:05 -0500 X-Authentication-Warning: shire.ontko.com: Host bilbo.ontko.com [199.164.165.101] claimed to be nick Reply-To: From: "Nick Fankhauser" To: "Manuel Trujillo" Cc: Subject: Re: table test Date: Fri, 30 Nov 2001 07:17:56 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <20011130094640.A15115@dorna.es> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Importance: Normal X-Archive-Number: 200111/192 X-Sequence-Number: 2717 Manuel- I'm still a bit confused, but will try to answer (maybe someone else can jump in with a better interpretation). Generally, the structure of the information you are storing should determine the structure of the tables, so if there are three distinct fields in the data, table one would be best, but if there are seven distinct fields, table two would be best. Regarding speed, fewer records (rows), will always result in faster access to the *record*, but if you then have to search among the fields (columns) within each record to get to the bit of data you need, then the gain is lost. That is why you should usually make the database structure closely match the information to be stored. This foundation starts you with the best situation. This is true regardless of the datatypes of the fields. There are probably a few exceptions, but this rule is true for most situations. The nature of your question has more to do with table structure than database administration, so I'd suggest going to the pgsql-sql or pgsql-general lists in the future- you might get better answers there. -Nick -------------------------------------------------------------------------- Nick Fankhauser nickf@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788 Ray Ontko & Co. Software Consulting Services http://www.ontko.com/ > -----Original Message----- > From: pgsql-admin-owner@postgresql.org > [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Manuel Trujillo > Sent: Friday, November 30, 2001 3:47 AM > To: Nick Fankhauser > Cc: pgsql-admin@postgresql.org > Subject: Re: [ADMIN] table test > > > On Thu, Nov 29, 2001 at 12:12:04PM -0500, Nick Fankhauser wrote: > > I did not understand the question. Can you restate your purpose > or tell us > > more about what you are trying to achieve? > > > > (No entendía la pregunta. ¿Puede usted exponer su propósito en forma > > modificada o decirnos más sobre lo que usted está intentando alcanzar?) > > Yes. We are try to achieve fields of "varchar" (with > indeterminate lenght, my boss is too bit explicit). > He only want to know, how is the fastest access to this table; > with the manner like "Table One", or the "Table Two". > Each table have only "varchar characters", about to 20-50 > characters of maximum lenght (I would like to think :(). > > > > > Table One: Table Two: > > > > 1 | 2 | 3 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | > > > > --------------- ----------------------------------------- > > > > 1|__|____|____| 1 ___|___|___|___|___|___|___|___|___|____| > > > > 2|__|____|____| 2 ___|___|___|___|___|___|___|___|___|____| > > > > . > > > > . > > > > . > > > > 7|__|____|____| > > > > > > > > > > > > How is the best way to know the better type of table of > this two types? > > Thank you very much. > > Have a nice day ;-) > TooManySecrets > > -- > Manuel Trujillo manueltrujillo@dorna.es > Technical Engineer http://www.motograndprix.com > Dorna Sports S.L. +34 93 4702864 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >