PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Rows vs indexing information
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Rows vs indexing information

Réponse
 
LinkBack Outils de la discussion
Vieux 10/04/2008, 14h38   #1
Vladimir Ghetau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Rows vs indexing information

Hi guys,

Which of the following approaches would you prefer when designing a
database?

- a table with more rows, but less information on each row
- or a table with less rows, but more information inside each row

I'm doing benchmarks, and trying to approach the problem in different
ways, but I also want to hear some opinion, maybe backed up by some
arguments

Thank you,

Vladimir Ghetau
  Réponse avec citation
Vieux 10/04/2008, 14h54   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information

On 10 Apr, 14:38, Vladimir Ghetau <vladi...@pixeltomorrow.com> wrote:
> Hi guys,
>
> Which of the following approaches would you prefer when designing a
> database?
>
> - a table with more rows, but less information on each row
> - or a table with less rows, but more information inside each row
>
> I'm doing benchmarks, and trying to approach the problem in different
> ways, but I also want to hear some opinion, maybe backed up by some
> arguments
>
> Thank you,
>
> Vladimir Ghetau


This has just been discussed in the NG!
  Réponse avec citation
Vieux 10/04/2008, 17h41   #3
ZeldorBlat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information

On Apr 10, 9:38 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
wrote:
> Hi guys,
>
> Which of the following approaches would you prefer when designing a
> database?
>
> - a table with more rows, but less information on each row
> - or a table with less rows, but more information inside each row
>
> I'm doing benchmarks, and trying to approach the problem in different
> ways, but I also want to hear some opinion, maybe backed up by some
> arguments
>
> Thank you,
>
> Vladimir Ghetau


As the Captain pointed out this was discussed very recently. Here's
the short answer:

1. Normalize your tables.
2. If they have more rows than columns then that is the correct
answer.
3. If they have more columns than rows then that is the correct answer.
  Réponse avec citation
Vieux 11/04/2008, 08h06   #4
Vladimir Ghetau
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information

On Apr 10, 5:41 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
> On Apr 10, 9:38 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
> wrote:
>
> > Hi guys,

>
> > Which of the following approaches would you prefer when designing a
> > database?

>
> > - a table with more rows, but less information on each row
> > - or a table with less rows, but more information inside each row

>
> > I'm doing benchmarks, and trying to approach the problem in different
> > ways, but I also want to hear some opinion, maybe backed up by some
> > arguments

>
> > Thank you,

>
> > Vladimir Ghetau

>
> As the Captain pointed out this was discussed very recently. Here's
> the short answer:
>
> 1. Normalize your tables.
> 2. If they have more rows than columns then that is the correct
> answer.
> 3. If they have more columns than rows then that is the correct answer.


Hi guys,

Thanks for your answer, but I wasn't saying anything about the number
of columns, let's explain the problem a little bit more, say we have
these two tables:

a)

group_ID | desc | tags
------------------------------
1 | null | a,b,c,d,e,f
2 | null | c,d,e,u,p,r

or table b)

tag_ID | group_ID | tag
---------------------------------
1 | 1 | a
2 | 1 | b
3 | 1 | c

So basically, I can:

a) either have all the tags in a single row of the tags column (see
table a), or
b) I can put each tag on it's own row, and search for tags this other
way (see table b)

What would you go for and why?

Thanks,

Vladimir Ghetau
  Réponse avec citation
Vieux 11/04/2008, 08h32   #5
Pavel Lepin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information


Vladimir Ghetau <vladimir@pixeltomorrow.com> wrote in
<53c1e0fe-e322-45e3-97d6-6c7c772bb557@u69g2000hse.googlegroups.com>:
> On Apr 10, 5:41 pm, ZeldorBlat <zeldorb...@gmail.com>
> wrote:
>> On Apr 10, 9:38 am, Vladimir Ghetau
>> <vladi...@pixeltomorrow.com> wrote:
>> > Which of the following approaches would you prefer when
>> > designing a database?

>>
>> > - a table with more rows, but less information on each
>> > row - or a table with less rows, but more information
>> > inside each row

>>
>> As the Captain pointed out this was discussed very
>> recently. Here's the short answer:
>>
>> 1. Normalize your tables.
>> 2. If they have more rows than columns then that is the
>> correct answer.
>> 3. If they have more columns than rows then that is the
>> correct answer.

>
> Thanks for your answer, but I wasn't saying anything about
> the number of columns, let's explain the problem a little
> bit more, say we have these two tables:
>
> group_ID | desc | tags
> ------------------------------
> 1 | null | a,b,c,d,e,f
> 2 | null | c,d,e,u,p,r


You've been told to normalise your schema. This violates
1NF.

--
"...a Netscape engineer who shan't be named once passed a
pointer to JavaScript, stored it as a string and later
passed it back to C, killing 30..." --Blake Ross
  Réponse avec citation
Vieux 11/04/2008, 09h43   #6
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information

On 11 Apr, 08:06, Vladimir Ghetau <vladi...@pixeltomorrow.com> wrote:
> On Apr 10, 5:41 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
>
>
>
> > On Apr 10, 9:38 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
> > wrote:

>
> > > Hi guys,

>
> > > Which of the following approaches would you prefer when designing a
> > > database?

>
> > > - a table with more rows, but less information on each row
> > > - or a table with less rows, but more information inside each row

>
> > > I'm doing benchmarks, and trying to approach the problem in different
> > > ways, but I also want to hear some opinion, maybe backed up by some
> > > arguments

>
> > > Thank you,

>
> > > Vladimir Ghetau

>
> > As the Captain pointed out this was discussed very recently. Here's
> > the short answer:

>
> > 1. Normalize your tables.
> > 2. If they have more rows than columns then that is the correct
> > answer.
> > 3. If they have more columns than rows then that is the correct answer.

>
> Hi guys,
>
> Thanks for your answer, but I wasn't saying anything about the number
> of columns, let's explain the problem a little bit more, say we have
> these two tables:
>
> a)
>
> group_ID | desc | tags
> ------------------------------
> 1 | null | a,b,c,d,e,f
> 2 | null | c,d,e,u,p,r
>
> or table b)
>
> tag_ID | group_ID | tag
> ---------------------------------
> 1 | 1 | a
> 2 | 1 | b
> 3 | 1 | c
>
> So basically, I can:
>
> a) either have all the tags in a single row of the tags column (see
> table a), or
> b) I can put each tag on it's own row, and search for tags this other
> way (see table b)
>
> What would you go for and why?
>
> Thanks,
>
> Vladimir Ghetau


Yes you were talking about the number of columns. I quote:
- a table with more rows, but less information on each row
- or a table with less rows, but more information inside each row

Inside a row you have columns. Insidea column you have data
(information).

The answer is the same as for the other thread. Normalise!
  Réponse avec citation
Vieux 11/04/2008, 18h01   #7
ZeldorBlat
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information

On Apr 11, 3:06 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
wrote:
> On Apr 10, 5:41 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
>
>
>
> > On Apr 10, 9:38 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
> > wrote:

>
> > > Hi guys,

>
> > > Which of the following approaches would you prefer when designing a
> > > database?

>
> > > - a table with more rows, but less information on each row
> > > - or a table with less rows, but more information inside each row

>
> > > I'm doing benchmarks, and trying to approach the problem in different
> > > ways, but I also want to hear some opinion, maybe backed up by some
> > > arguments

>
> > > Thank you,

>
> > > Vladimir Ghetau

>
> > As the Captain pointed out this was discussed very recently. Here's
> > the short answer:

>
> > 1. Normalize your tables.
> > 2. If they have more rows than columns then that is the correct
> > answer.
> > 3. If they have more columns than rows then that is the correct answer.

>
> Hi guys,
>
> Thanks for your answer, but I wasn't saying anything about the number
> of columns, let's explain the problem a little bit more, say we have
> these two tables:
>
> a)
>
> group_ID | desc | tags
> ------------------------------
> 1 | null | a,b,c,d,e,f
> 2 | null | c,d,e,u,p,r
>
> or table b)
>
> tag_ID | group_ID | tag
> ---------------------------------
> 1 | 1 | a
> 2 | 1 | b
> 3 | 1 | c
>
> So basically, I can:
>
> a) either have all the tags in a single row of the tags column (see
> table a), or
> b) I can put each tag on it's own row, and search for tags this other
> way (see table b)
>
> What would you go for and why?
>
> Thanks,
>
> Vladimir Ghetau


If you follow my previous advice then A isn't even an option.
  Réponse avec citation
Vieux 11/04/2008, 20h15   #8
Michael Austin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Rows vs indexing information

ZeldorBlat wrote:
> On Apr 11, 3:06 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
> wrote:
>> On Apr 10, 5:41 pm, ZeldorBlat <zeldorb...@gmail.com> wrote:
>>
>>
>>
>>> On Apr 10, 9:38 am, Vladimir Ghetau <vladi...@pixeltomorrow.com>
>>> wrote:
>>>> Hi guys,
>>>> Which of the following approaches would you prefer when designing a
>>>> database?
>>>> - a table with more rows, but less information on each row
>>>> - or a table with less rows, but more information inside each row
>>>> I'm doing benchmarks, and trying to approach the problem in different
>>>> ways, but I also want to hear some opinion, maybe backed up by some
>>>> arguments
>>>> Thank you,
>>>> Vladimir Ghetau
>>> As the Captain pointed out this was discussed very recently. Here's
>>> the short answer:
>>> 1. Normalize your tables.
>>> 2. If they have more rows than columns then that is the correct
>>> answer.
>>> 3. If they have more columns than rows then that is the correct answer.

>> Hi guys,
>>
>> Thanks for your answer, but I wasn't saying anything about the number
>> of columns, let's explain the problem a little bit more, say we have
>> these two tables:
>>
>> a)
>>
>> group_ID | desc | tags
>> ------------------------------
>> 1 | null | a,b,c,d,e,f
>> 2 | null | c,d,e,u,p,r
>>
>> or table b)
>>
>> tag_ID | group_ID | tag
>> ---------------------------------
>> 1 | 1 | a
>> 2 | 1 | b
>> 3 | 1 | c
>>
>> So basically, I can:
>>
>> a) either have all the tags in a single row of the tags column (see
>> table a), or
>> b) I can put each tag on it's own row, and search for tags this other
>> way (see table b)
>>
>> What would you go for and why?
>>
>> Thanks,
>>
>> Vladimir Ghetau

>
> If you follow my previous advice then A isn't even an option.



Deja vu. do you guys get the feeling that there is a course out there
handing out this particular homework assignment?

Still people trying to be DBA's that shouldn't even own a computer - let
alone being some sort of admin...


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h52.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,20857 seconds with 16 queries