Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

Subjunctive posted:

Performance? Denormalization can be cool and good.

I don't want to dump the schema/data here, but performance is presently an issue. As is figuring out where the hell anything is. Performance is mostly an issue because it's impossible to reason about the data rationally, so everything is done with between 3-4 and 3-4N more subqueries than necessary.

Good effort though. :unsmith:

Adbot
ADBOT LOVES YOU

Kazinsal
Dec 13, 2011


Here's some coding horror in the prosumer products world: http://appleinsider.com/articles/16/02/12/bug-in-adobe-creative-cloud-updater-erases-root-level-mac-data

Adobe pushes an update for Creative Cloud on Macs that makes the assumption that they're going to be the first folder in the root directory and that whatever comes first is okay to wipe out. Some users don't have that folder and the first one in the list for them is .DocumentRevisions-V100, which is the OS X equivalent of the volume shadow copy store on Windows.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

Amberskin posted:

Him: Oh, the business spec says that field can have just 10 values. I've defines 20 just to be safe. It will never exceed that, legit!

This is the part where you beat them to death with the nearest fire extinguisher.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer
This conversation inspired me to refresh my memory of 1NF, 2NF, 3NF, BCNF, etc. I've seen a lot of stupid stuff in database table design, but I don't think I've ever seen a table that fails to satisfy 1NF in any software I've worked on. The only thing that comes to mind is certain dynamic columns intended to contain arbitrary data that's validated elsewhere, possibly including comma-separated lists of values. But I think that's basically acceptable, if a little clumsy.

nielsm
Jun 1, 2009



LOOK I AM A TURTLE posted:

This conversation inspired me to refresh my memory of 1NF, 2NF, 3NF, BCNF, etc. I've seen a lot of stupid stuff in database table design, but I don't think I've ever seen a table that fails to satisfy 1NF in any software I've worked on. The only thing that comes to mind is certain dynamic columns intended to contain arbitrary data that's validated elsewhere, possibly including comma-separated lists of values. But I think that's basically acceptable, if a little clumsy.

Nah, "a list of things in one column" is a normal form violation. One way to think about it is, whether you could reasonably do a join against that column.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

nielsm posted:

Nah, "a list of things in one column" is a normal form violation. One way to think about it is, whether you could reasonably do a join against that column.

I'm not sure which part of my post your "Nah" is referring to, but I get that a list inside a field violates 1NF. I'm just saying there's a difference between this:

Products: (ProductId, Name, ExtraField1, ExtraField2, ExtraField3, ...)

And this:

Products: (ProductId, Name)
ExtraFields: (ExtraFieldId, Name)
ExtraProductFields: (ProductId, ExtraFieldId, Value)

The idea is that you don't know at design time what's going to be in ExtraFields, and one of the things might turn out to be "ListOfSomething". If you're putting lists of things in Value then it's still a violation of 1NF, but it's a lot less crappy than the first version. I realize you could have an ExtraProductFieldParts with a foreign key to ExtraProductFields to allow lists without denormalization, but that would probably be less efficient if the most common case is for SomeArbitraryString to contain an atomic value, and it would complicate the design.

Whether these "dynamic" tables are a good idea in the first place is a different matter (they're basically a small, non-typesafe database inside a typesafe database), but they seem to be pretty common in my experience.

Amberskin
Dec 22, 2013

We come in peace! Legit!

nielsm posted:

Nah, "a list of things in one column" is a normal form violation. One way to think about it is, whether you could reasonably do a join against that column.

It is unacceptable. Specially if the "designer" uses a CHAR column to store a structure. Specially if that structure contains text, binary and packed (decimal) fields. Everything is nice and everyone is happy because in PL/I or COBOL you can define arbitrary overlays over memory blocks. But as soon as you try to downsize the application and read that information from a distributed system you see the JDBC driver trying to apply EBCDIC to UTF-8 translation to integers and packeds. So you have to cast the column to CHAR(x) FOR BIT DATA. And then you have to do the conversions yourself, including the big endian to little endian stuff.

Lots of fun.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
I think that problem is less of a database one (binary blobs are perfectly acceptable as far as I'm concerned) and more of a "serializing things by dumping the raw memory" problem. Which, at the very best, is rather dangerous assuming you're dealing with perfectly uniform hardware. Anything else and it'll blow up sooner or later. That goes for sending things over a network or writing them to a file or a bunch of other things that don't have much to do with databases.

Edit: Oh, and using CHAR columns for storing binary data is obviously dumb, too.

rarbatrol
Apr 17, 2011

Hurt//maim//kill.
For databases that support it, I like sweeping "expansion-friendly" data into JSON/XML data types where normalizing isn't really feasible. At work, somebody tried to do this many years ago, but used a varchar column instead of XML... now it's full of definitely-not-XML and there's a bunch of janky methods that people use to query against it. Migration is almost out of the question because it's literally the largest and most important (from a legal perspective) table.

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
Someone at my job decided the best way to log API requests was in a table with two columns, IDENTITY and a VARCHAR(MAX) that holds the JSON object of the request. These JSON objects are massive, because they log a lot of information related to telephony jitter and statistics. We literally cannot do anything with this table because to filter on it in any useful manner you need to parse the JSON in the VARCHAR column, and doing that makes the DB grind to a halt.

xzzy
Mar 5, 2009

A co-worker a long ways back did a mysql disaster like that. Idiots making stupid schemas aren't uncommon, there's a million stories about it around the internet. What got me is when he started the task he assured the entire group he'd "done mysql before" and was familiar with how to do things so it would work well.

It was a store for syslog messages so we could search for certain failures and alert on them. His grand idea was to store everything as strings: dates, messages, facilities.. all of it. After feeding 500+ nodes into this database and getting mad that his queries were taking too long, he slapped an index on every column and set up an even worse scheme of rotating tables once a week to keep them from getting too big.

After he quit (but not before he got promoted into management) I deleted the whole stupid thing and replaced it with rsyslog.

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

Asymmetrikon posted:

Someone at my job decided the best way to log API requests was in a table with two columns, IDENTITY and a VARCHAR(MAX) that holds the JSON object of the request. These JSON objects are massive, because they log a lot of information related to telephony jitter and statistics. We literally cannot do anything with this table because to filter on it in any useful manner you need to parse the JSON in the VARCHAR column, and doing that makes the DB grind to a halt.

Scanning an entire table will tend to do bad things to DB performance, yeah.

xzzy posted:

It was a store for syslog messages so we could search for certain failures and alert on them. His grand idea was to store everything as strings: dates, messages, facilities.. all of it. After feeding 500+ nodes into this database and getting mad that his queries were taking too long, he slapped an index on every column and set up an even worse scheme of rotating tables once a week to keep them from getting too big.

Indices make queries faster therefore more indices will make things go even faster. If things are still slow, then that means you need to start adding composite indices. All of them, ideally. This is where he failed.

It's amazing the number of people who somehow believe something along those lines.

leper khan
Dec 28, 2010
Honest to god thinks Half Life 2 is a bad game. But at least he likes Monster Hunter.

YeOldeButchere posted:

Scanning an entire table will tend to do bad things to DB performance, yeah.


Indices make queries faster therefore more indices will make things go even faster. If things are still slow, then that means you need to start adding composite indices. All of them, ideally. This is where he failed.

It's amazing the number of people who somehow believe something along those lines.

Maybe I should bring up the genius at an old job who decided to implement an RDBMS on top of a NOSQL DB because NOSQL is better. Every query was an index, so he limited the maximum number of different queries for performance reasons.

Soricidus
Oct 21, 2010
freedom-hating statist shill

Kazinsal posted:

Here's some coding horror in the prosumer products world: http://appleinsider.com/articles/16/02/12/bug-in-adobe-creative-cloud-updater-erases-root-level-mac-data

Adobe pushes an update for Creative Cloud on Macs that makes the assumption that they're going to be the first folder in the root directory and that whatever comes first is okay to wipe out. Some users don't have that folder and the first one in the list for them is .DocumentRevisions-V100, which is the OS X equivalent of the volume shadow copy store on Windows.

quoting this actually funny post in the vain hope that it will not get drowned out by people talking about database normalization

nielsm
Jun 1, 2009



Kazinsal posted:

Here's some coding horror in the prosumer products world: http://appleinsider.com/articles/16/02/12/bug-in-adobe-creative-cloud-updater-erases-root-level-mac-data

Adobe pushes an update for Creative Cloud on Macs that makes the assumption that they're going to be the first folder in the root directory and that whatever comes first is okay to wipe out. Some users don't have that folder and the first one in the list for them is .DocumentRevisions-V100, which is the OS X equivalent of the volume shadow copy store on Windows.

But I wonder what Adobe was actually trying to do there. What is it supposed to be deleting?

xzzy
Mar 5, 2009

The more things change, the more they stay the same:

http://minimaxir.com/2013/06/working-as-intended/

(bungie's myth 2 installer did the same thing, except it would wipe out the entire hard drive)

rarbatrol
Apr 17, 2011

Hurt//maim//kill.

nielsm posted:

But I wonder what Adobe was actually trying to do there. What is it supposed to be deleting?

Since it's in the context of an upgrade, I'm guessing the old "Adobe-whatever" installation folder? It's really sloppy to assume Adobe comes first, though.

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

LOOK I AM A TURTLE posted:

This conversation inspired me to refresh my memory of 1NF, 2NF, 3NF, BCNF, etc. I've seen a lot of stupid stuff in database table design, but I don't think I've ever seen a table that fails to satisfy 1NF in any software I've worked on. The only thing that comes to mind is certain dynamic columns intended to contain arbitrary data that's validated elsewhere, possibly including comma-separated lists of values. But I think that's basically acceptable, if a little clumsy.

I work at a non-technical company where our inventory database does not meet 1NF. We make a relatively small number of database accesses per day using a limited number of (never maintained) reports that are slow as a dog, despite checking only a few tens of thousands of records. It's not my job to improve this database in any way and I doubt any of my superiors would understand why or how it could be improved, so I leave it as is.

Nude
Nov 16, 2014

I have no idea what I'm doing.

xzzy posted:

The more things change, the more they stay the same:

http://minimaxir.com/2013/06/working-as-intended/

(bungie's myth 2 installer did the same thing, except it would wipe out the entire hard drive)

Steam at one point did as well when you ran it.

raminasi
Jan 25, 2005

a last drink with no ice
One of the EVE online installers would blow away boot.ini.

Metaconcert
Nov 28, 2010

"And my answer is when there are nine"
I have no hope that we will learn, only that we will stop letting software do this sort of thing.

Regrettable: removing a method because you couldn't fix it.
More regrettable: being unable to update to the version that removed said method because you use it everywhere.

pseudorandom name
May 6, 2007

Nude posted:

Steam at one point did as well when you ran it.

As far as anyone can tell, this was the FUSE NTFS driver crashing and then Steam reacting in the worst possible way to the "impossible".

TheresaJayne
Jul 1, 2011

I think it rhymes with Hanker and W^&*er

TheresaJayne
Jul 1, 2011

YeOldeButchere posted:

Scanning an entire table will tend to do bad things to DB performance, yeah.


Indices make queries faster therefore more indices will make things go even faster. If things are still slow, then that means you need to start adding composite indices. All of them, ideally. This is where he failed.

It's amazing the number of people who somehow believe something along those lines.

I worked on a project once, We had a database with 3 Tables,

Data, Archive, Logs

All 3 tables were Identical

ID
Primary
Secondary
Description
Type
Data (BLOB)


We used the primary and secondary keys and description linked with type for the records, Any other field was stored in the Data blob as XML and we parsed Name Value pairs on loading each record into a HashMap

Worked fine in development until we tried to use it to send 3 million SMS messages in a marketing push. - It then took 48 hours to send 300.

We then ripped it apart and turned it into a decent Database design, - The original design was done by a contractor whos main job was senior developer at Credit Suisse

qntm
Jun 17, 2009

pseudorandom name posted:

As far as anyone can tell, this was the FUSE NTFS driver crashing and then Steam reacting in the worst possible way to the "impossible".

I thought it was because they were running rm -rf ${STEAMROOT}/* without bothering to check whether $STEAMROOT had been defined?

necrotic
Aug 2, 2005
I owe my brother big time for this!

qntm posted:

I thought it was because they were running rm -rf ${STEAMROOT}/* without bothering to check whether $STEAMROOT had been defined?

Yup. FUSE NTFS was involved in discovering the bug, but the bug was the missing check for STEAMROOT.

Amberskin
Dec 22, 2013

We come in peace! Legit!

TheresaJayne posted:



We then ripped it apart and turned it into a decent Database design, - The original design was done by a contractor whos main job was senior developer at Credit Suisse

He probably came from an IMS-DB background. In IMS-DB is quite usual to define just the key fields and use a binary blob for the rest of the data. This way the developer has the :airquote: flexibilty :airquote: of using the same segment (thats how records are called in IMS) to store different kinds of data. A lot of ex-IMS developers reconverted to the relational world do the same.

Everything is fine until someone wants to do data mining over those tables. Then the ETL party begins.

chippy
Aug 16, 2006

OK I DON'T GET IT
There's a developer here who frequently makes fairly large commits of assorted unrelated changes with the title 'Committed pending changes'. :(

sunaurus
Feb 13, 2012

Oh great, another bookah.
I'm working on a project where some code is quite old. I was recently looking up some commits associated with some older parts of the codebase (I wanted to find the associated JIRA issues). All of the commits I found had 50-100 files in them, and each commit message referenced ~20 completely unrelated JIRA issues - the commit messages were just comma separated lists of issue keys.
I assumed that the developer making these commits had been terrible, but when I asked a senior dev on my team about this, it turned out that this was standard practice. Apparently, for the first year of development, each single commit had to be approved by someone (who wasn't a developer - this wasn't code review), so in order to work efficiently, the commits were huge.
I really hope I never have to go looking for old JIRA issues again.

Bognar
Aug 4, 2011

I am the queen of France
Hot Rope Guy

chippy posted:

There's a developer here who frequently makes fairly large commits of assorted unrelated changes with the title 'Committed pending changes'. :(

I see "wip" as a commit message way more than I want to.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer

Illegal Move posted:

in order to work efficiently, the commits were huge.

Truly the mark of a great methodology.

Cuntpunch
Oct 3, 2003

A monkey in a long line of kings

Bognar posted:

I see "wip" as a commit message way more than I want to.

We have a developer who will often check things in with just 'phase 1 comp' and then there's 25 unrelated files across 3 different stories of work. And pretty much never a phase 2.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Nude posted:

Steam at one point did as well when you ran it.

The nVidia GeForce Experience crap rm -rf C:-ed my desktop a couple years ago when it updated itself. It was really confusing because everything I was already using kept working for the most part because files were locked, so it couldn't nuke everything and I have automated nightly backups, so I wasn't too hosed. Took a long time for me to stop making a manual backup before letting it do anything again.

pseudorandom name
May 6, 2007

qntm posted:

I thought it was because they were running rm -rf ${STEAMROOT}/* without bothering to check whether $STEAMROOT had been defined?

STEAMROOT is unconditionally set to the path of the directory containing the currently executing script.

At some point between the script starting execution and the calculation of STEAMROOT, the directory containing the script vanished.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

chippy posted:

There's a developer here who frequently makes fairly large commits of assorted unrelated changes with the title 'Committed pending changes'. :(

"Reverted accidental changes" is your next move. If she'd meant them to be part of the mainline, she'd have documented them.

Slanderer
May 6, 2007

Nude posted:

Steam at one point did as well when you ran it.

The deeper I go into the comments the spergier it gets

quote:

All bug fixes from Steam/Valve will be wrong unless they do a cultural change in how they write their software.

Talking about NTFS drives is something no one should even think about on Linux (the FS should never matter)
Not having case-sensitive drive support on MacOS X is even worse
And then here's this poo poo - rm -rf /*
Then again, how about Retina support? (and I'm not speaking of OS X only, I run a linux rig with a 4K display at work)
Please add anything you know of, I just got tired

edit:
jesus christ, the last one lol

quote:

Solution: Just don’t delete user data. Ever.

Slanderer fucked around with this message at 18:48 on Feb 15, 2016

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Slanderer posted:

The deeper I go into the comments the spergier it gets


edit:
jesus christ, the last one lol

Daily-driver Linux users are spergy?! :monocle:

xzzy
Mar 5, 2009

My professional life revolves around linux, and I'm not spergy. :colbert:

Well, maybe a little. But I am self aware and can make jokes about it.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



By "Daily Driver" I mean "uses it at home voluntarily because they really want to"

Adbot
ADBOT LOVES YOU

JawnV6
Jul 4, 2004

So hot ...

xzzy posted:

I am self aware and can make jokes about it.
The best most of us can hope for, really.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply