Hello, I’m working with an.

 
Monville: Betterton: in a wrong order probably

Rumery: Betterton, order of composite indexes matters

Hencken: Also you don’t need to join products table to get that result

Sperrey: Sorry, you actually need it

Rumery: And “countDISTINCT products.id” probably too

Clyatt: Betterton: Are you sure you want to count the number of rows in the result of join? You are not counting products this way

Winfield: Salle, Yeah, I just want to count the distinct products and this is the only way I kinda know how to

Rumery: Betterton, add index country_id, campaign_id to campaign_countries and fix the count – then check and paste query, explain and create table

Clyatt: Betterton: So why do you ignore Boleware and Rumery when they tell you to use COUNTDISTINCT product.id ?

Fujimura: Hi guys how can create a trigger to update multiple columns of the same table?

Fujimura: I have something like create trigger before insert into tablename on db.tablename for each row set .

Fujimura: How can do the same for multiple columns?

Rybacki: You missed the part of the trigger which actually updates

Rumery: Fujimura, trigger runs for each inserted row, you have all columns at your disposal in there

Fujimura: Uhm how can do that sorry?

Decomo: Have you seen NEW. and OLD. in trigger do***entation?

Poleyestewa: In BEFORE insert you only have access to NEW

Brom: So what you have to do is SET NEW.col1 = ‘a’; SET NEW.col2 = ‘b’;

Shockency: And they have to be between BEGIN and END

Halder: Http://dev.mysql.com/doc/refman/5.1/en/trigger-Niedzwiedzki.html

Eberheart: Find: By using the BEGIN . END construct, you can define a trigger that executes multiple statements.

Fujimura: Create trigger mytrig before insert into mytable begin for each row set NEW.column1=.; set NEW.column2=.; END;

Crocket: Fujimura: Doesn’t work is not a helpful statement. Was there an error? Unexpected results? Does it sit on the couch all day eating all your cheetos and ignoring the cl***ifieds? Be specific!

Yeh: What’s the query to give a new user read access to a particular database? One that creates that new user inline

Uglum: Kamuela: See http://dev.mysql.com/doc/refman/5.6/en/grant.html

Stankowitz: Is it because GRANT is a table-level command?

Kemerer: Then what would myfulldb.this_thing refer to? I mean, what is this_thing in relation to myfulldb?

Seekford: And if newuser indeed wasn’t a local user, what would be the remote-agnostic way of identifying it? I have seen ‘%’ used in place of localhost sometimes, what is the significance there?

Buganski: So would that allow a remote connection as well for that user?

Laurenti: Thank you Boleware I’m gonna give that grant page you linked more attention and I’ll ask something more specific when it comes up

Talbert: What is the best way to show top/trending stories in my app?

Ringering: Based on number of likes/comments.? something like reddit/digg/instagram do it?

Wohlgemuth: Any idea to optimize this query? it takes so long to execute. SELECT * FROM pds_reports,pds_users_test WHERE pds_reports.user=pds_users_test.user AND pds_reports.active=1 AND pds_reports.type=’کارنامه’ AND pds_reports.date=’1432236600′ AND pds_reports.date=’1442258999′ AND pds_reports.user=’0023057890′ ORDER BY pds_reports.date DESC , pds_users_test.lname ASC , pds_users_test.fname ASC LIMIT 200

Zemon: Howdy all. Does anyone know of a chat channel around database model design? For database-agnostic discussion round building database schemas?

Lavelli: OnceMe: Now that makes sense, thanks a bunch! :

Coval: Hey guys , i want to make a group by , but instead of grouping to rows . i want to make them as columns . does that make any sense ?

Paulsen: Hello, I’m working with an app that persists a ton of information which results in really slow load speeds. This app is really far behind as in comparison to others, it takes about 8 seconds to load. Any suggestions on how to improve this?