Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread David Schneider-Joseph
Try this one: SELECT a.username, a.first_name, a.last_name,COALESCE(COUNT(b.username), 0) AS count FROM user_list a LEFT JOIN login_table b ON a.username = b.username GROUP BY a.username,a.first_name,a.lastname; The LEFT JOIN will ensure you still get a result row even if there are no match

Re: transfer huge mysql db

2008-01-30 Thread David Schneider-Joseph
On Jan 30, 2008, at 10:44 AM, Jerry Schwartz wrote: mysqldump -A > file.dump tar -jcf file.dump rsync [JS] You could also just pipe the output of mysqldump through gzip. tar buys you nothing, since it is a single file. -j is the bzip2 compression option. :) [JS] Yes, but tar is just extra b

Re: transfer huge mysql db

2008-01-29 Thread David Schneider-Joseph
Is there a reason this wouldn't work with InnoDB? (I understand there's usually a single ibdata file, but so?) On Jan 24, 2008, at 8:08 AM, Matthias Witte wrote: On Thu, Jan 24, 2008 at 01:42:38PM +0200, Ivan Levchenko wrote: Hi All, What would be the best way to transfer a 20 gig db from

Re: transfer huge mysql db

2008-01-29 Thread David Schneider-Joseph
On Jan 29, 2008, at 10:02 AM, Jerry Schwartz wrote: mysqldump -A > file.dump tar -jcf file.dump rsync [JS] You could also just pipe the output of mysqldump through gzip. tar buys you nothing, since it is a single file. -j is the bzip2 compression option. :) -- MySQL General Mailing List

Re: Mass insert on InnoDB

2008-01-29 Thread David Schneider-Joseph
On Jan 29, 2008, at 6:21 PM, BJ Swope wrote: drop the indexes for the conversion then rebuild the indexes after the tables are converted. As noted in my original email, I tried that, but Jan's suggestion re: InnoDB tuning fixed it. Thanks for the advice, everyone! David -- MySQL General

Re: Mass insert on InnoDB

2008-01-29 Thread David Schneider-Joseph
On Jan 29, 2008, at 7:04 PM, Jan Kirchhoff wrote: play around with innodb_log_buffer_size, innodb_log_file_size and try to set innodb_flush_log_at_trx_commit=0. Do you don't have a BBU on your raid-controller? let me know if that changes anything. That did it! I upped the log_buffer_size

Re: Mass insert on InnoDB

2008-01-29 Thread David Schneider-Joseph
On Jan 29, 2008, at 6:09 PM, Jan Kirchhoff wrote: what hardware are you running on and you much memory do you have? what version of mysql?| | How did you set innodb_buffer_pool_size? Hardware: Dual AMD Opteron 246 2.0 GHz 4 GB DDR RAM (no swap being used) Dual 146 GB SCSI drives with a RAID

Re: Mass insert on InnoDB

2008-01-29 Thread David Schneider-Joseph
On Jan 29, 2008, at 4:37 PM, Baron Schwartz wrote: It's because your index is bigger than your memory (or at least bigger than your InnoDB buffer pool). InnoDB can't build indexes by sorting rows, so building the indexes gets slow. Hmm, this would be an interesting theory for the main table i

Mass insert on InnoDB

2008-01-29 Thread David Schneider-Joseph
Hi all, I am attempting to convert a very large table (~23 million rows) from MyISAM to InnoDB. If I do it in chunks of one million at a time, the first million are very fast (approx. 3 minutes or so), and then it gets progressively worse, until by the time I get even to the fourth chunk

Re: Trigger problem

2007-11-07 Thread David Schneider-Joseph
t. Yes, it's dumb. On Nov 7, 2007, at 2:53 AM, Lucky Wijaya wrote: No, I didn't set the delimiter. But, it still have an error after I set delimiter in my trigger as your example. By the way, what's delimiter mean ? And what it's for ? Thanks to you Mr. David. David

Re: Trigger problem

2007-11-06 Thread David Schneider-Joseph
Lucky, Did you make sure to set your delimiter before and after the CREATE TRIGGER statement? e.g.: DELIMITER ;; CREATE TRIGGER DEL_TB_INSTRUKSI AFTER DELETE ON Tb_Instruksi FOR EACH ROW BEGIN DELETE FROM Tb_Stuffing WHERE No_Instruksi = OLD.No_Instruksi; END;; DELIMITER ; On Nov 6, 2007

Re: Conflicting server IDs on slaves

2007-09-14 Thread David Schneider-Joseph
/bugs.mysql.com/bug.php?id=16927 This occurred shortly after the server ID conflict, and exactly when the master was melting down. David On Sep 14, 2007, at 4:11 AM, Jeremy Cole wrote: Hi David, This sounds strange, and should NOT occur because of a server_id conflict. Regards, Jeremy Da

Re: Conflicting server IDs on slaves

2007-09-13 Thread David Schneider-Joseph
, Shawn Green wrote: Hello David, David Schneider-Joseph wrote: Hi all, What do you know about the effect of conflicting slave server IDs on the master in general? And specifically, are you aware of any issues with MySQL 5.0.27? Your help is very much appreciated. Thanks! David Repeating

Conflicting server IDs on slaves

2007-09-12 Thread David Schneider-Joseph
Hi all, What do you know about the effect of conflicting slave server IDs on the master in general? And specifically, are you aware of any issues with MySQL 5.0.27? Your help is very much appreciated. Thanks! David -- MySQL General Mailing List For list archives: http://lists.mysql.com/m

Re: What should be a simple query...

2007-09-11 Thread David Schneider-Joseph
Try this: SELECT RMAs.rma_id FROM RMAs, rma_line_items WHERE TO_DAYS(date_settled) = 733274 AND RMAs.rma_id = rma_line_items.rma_id GROUP BY RMAs.rma_id HAVING COUNT(*) > 1 On Sep 10, 2007, at 11:36 PM, Mike Mannakee wrote: I have two tables, one called RMAs and the other called rma_line_item

Data corruption and server crash issues in replicated setup

2007-09-10 Thread David Schneider-Joseph
Hi all, Starting Wednesday night, we observed several weird errors indicative of data corruption shortly before a CPU spike and complete crash on our master db server (opera.oursite.com). opera.oursite.com had crashed twice with signal 11 in recent weeks, but we had never observed any data corrup