Okoye: If I have tables users and posts and posts.user_id is a column. The foreign key should go onto posts and the “referenced table” is users correct?
Buetti: Fk constraints are defined in the child table and reference the parent
Haywood: Why does the database need to check if a user exists on every post?
Polumbo: Isn’t ensuring referential integrity a “good thing” ?
Buetti: Polumbo: if it’s worth the cost, sure
Buetti: Polumbo: like if you were a bank handling other people’s money :-
Polumbo: Hrm perhaps I should stop learning SQL from wikipedia
Haywood: I mean how bad is your system that a deleted user can still post?
Haywood: If domas was still here he could tell us if wikipedia uses foreign keys
Buetti: Polumbo: you can do a lot of that at the application level
Polumbo: Haywood: it was going to be beautiful with DKNF and foreign keys as far as the eye could see. But I suppose performance would be terrible
Buetti: Polumbo: you’re on the right track. gotta be real good with normalization to decide when to de-normalize for performance :-
Oschmann: Anyone cna try help me with this: http://pastie.org/10395976 the if not work for me
Buetti: Polumbo: that being said, fk constraints have their place
Polumbo: Is there a real world guide to DB design?
Buetti: Polumbo: yes. it’s called life.
Buetti: Polumbo: find someone willing to pay you while you gain experience
Pete: Buetti, that’s what I had said, right?
Polumbo: It’s just for a side project for now
Buetti: Keesler: to be candid, I don’t consider a foreign key and a foreign key constraint to be equivalent, but some GUIs and some sql theorists consider them to be the same
Buetti: Keesler: but foreign key constraints require considerable overhead, and are unforgiving of app code sloppiness.
Sibeto: Buetti, wait, I’ve not ever heard them referenced as distinct things?
Buetti: Keesler: well, if you had a one-to-many table relationship without an fk constraint, would you still consider the child table column that stored the parent table PK a foreign key? I would.
Buetti: Keesler: even if it allowed orphans
Buetti: Keesler: orphan blog comments aren’t a tragedy :-
Buetti: Keesler: orphan bank deposits, now that’s a tragedy
Vanostberg: Buetti, you’re saying that the presence of an FK constraint has notable performance implications?
Buetti: Keesler: every insert has to verify the corresponding parent table value existence. would that be free?
Buetti: Keesler: and every error handled
Gardin: Well, I knew it wouldn’t be free.but I didn’t think it would be that impactful.
Buetti: Keesler: it all depends, right? Big data, big problems, little data, little problems, no data, no problems. :-
Deliberato: Buetti, can you comment real quick about how significant the performance difference is in req vs eq req vs index merge for join performance?
Colsch: I’ve not done any query profiling, but I have a query that’s aggregating a lot of data and is running very long 50 seconds for a very central business need
Buetti: Keesler: summary tables mollify demanding users
Buetti: Keesler: and how exact does exact have to be?
Mckesson: Haywood: yes, it’s a suicide note
Fajardo: I am doing a homework ***ignment and I need to use visual studio to create a functional input screen. I opened a “Windows Form Application” which worked. Then I tried to add a “Service-Based Database” which is not working! I get the following error http://imgur.com/Xl4uQ6w
Sopko: But I have SQL Server Data Tools installed
Leard: Im using visual studio community 2015
Pomar: Microsoft .net framework version 4.6.00081
Neave: Hey, should this work in mysql: “DELETE FROM job_requests WHERE ID NOT IN SELECT TOP 10 ID FROM job_requests;”