The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. January 08, 2009, 12:43:50 AM

Login with username, password and session length


Pages: 1 [2]
  Print  
Author Topic: Is There Something Simpler than RDBs?  (Read 863 times)
vsloathe
vim ftw!
Global Moderator
Lifer
*****
Offline Offline

Posts: 679



View Profile
« Reply #15 on: July 31, 2008, 07:59:16 AM »

Not sure I adequately grok you Bomps. Can you post an example?
Logged

perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 5324


:sniffle: Humor was so much easier before.


View Profile
« Reply #16 on: July 31, 2008, 09:12:40 AM »

Me neither... but it sounds like you have many rows of data that are (sometimes) referencing the same primary key. Is this correct:

Item A
Item B
Item C
Item B
Item D
Item A
Item A

... after the importation of which you'd want a table that had:
Item A: 3
Item B: 2
Item C: 1
Item D: 1

... is that correct? If so, then yes, you want a single table with the primary key being the item you require to be unique and a "tally" column that keeps the number of occurrences.

But it sounds to me like if you could post an example of some data we'd all do better for you here...
Logged

If I can't be Mr. Root then I don't want to play.
jammaster82
Expert
****
Offline Offline

Posts: 300

bloody hacker


View Profile WWW
« Reply #17 on: July 31, 2008, 11:04:24 AM »

I would always just go with storing the data, whatever it is
and not locking the formula/calculation or information about
it in a field because you may want to later VIEW the data
a different way...  hard disks are so cheap and mysql runs
so fast you can make a stored procedure for just about
any way you want to look at the data, and not have to
rethink your mechanisms...
Logged

Of course Big Brother exists, he is the embodiment of the party..... Does he exist in the same way I exist?....... You, do not exist.
perkiset
Olde World Hacker
Administrator
Lifer
*****
Online Online

Posts: 5324


:sniffle: Humor was so much easier before.


View Profile
« Reply #18 on: July 31, 2008, 12:12:31 PM »

Entirely true, and a

select item, count('x') from table group by item

is clearly a fast way to do it, but if you are ALWAYS doing that then it makes sense to normalize the data first... but I'd normally agree that raw data is better.
Logged

If I can't be Mr. Root then I don't want to play.
Bompa
Administrator
Expert
*****
Offline Offline

Posts: 219


View Profile WWW
« Reply #19 on: July 31, 2008, 05:24:10 PM »

Me neither... but it sounds like you have many rows of data that are (sometimes) referencing the same primary key. Is this correct:

Item A
Item B
Item C
Item B
Item D
Item A
Item A

... after the importation of which you'd want a table that had:
Item A: 3
Item B: 2
Item C: 1
Item D: 1

... is that correct? If so, then yes, you want a single table with the primary key being the item you require to be unique and a "tally" column that keeps the number of occurrences.

But it sounds to me like if you could post an example of some data we'd all do better for you here...

Perk, you hit the nail on its head.  A good example, in theory, would be WordTracker.  If you search
WT for "fart fetish", WT will tell you how many times "fart fetish" occurs in their db as an exact phrase
and also as part of a longer phrase like "JM's best fart fetish videos".  Wink

Either they have a tally field or they are counting the raw data everytime.

Of course, counting the occurances in longer phrases will entail counting the raw data everytime.

I like the idea of counting the raw data, but if 50% of the daily imported data is unique,
the db is going to grow like Jack's beanstalk on Viagra.

I can't give you a sample of my data cuz then I'd have to kill you.  Most of you could
build and implement this before I finish my coffee. 


But you've all given me food for thought here, thanks.
Bompa
Logged

jammaster82
Expert
****
Offline Offline

Posts: 300

bloody hacker


View Profile WWW
« Reply #20 on: July 31, 2008, 07:48:26 PM »

Quote

"JM's best fart fetish videos".  Wink


:: deletes all cookies ::      D'oh!  ROFLMAO

Logged

Of course Big Brother exists, he is the embodiment of the party..... Does he exist in the same way I exist?....... You, do not exist.
Pages: 1 [2]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!