RE: Calling function, that operates on another database

2014-04-08 Thread David Lerer
Chris, take a look at Federated tables https://dev.mysql.com/doc/refman/5.5/en/federated-storage-engine.html No, it is not as easy as Oracle's dblinks. David. David Lerer | Director, Database Administration | Interactive | 605 Third Avenue, 12th Floor, New York, NY 10158 Direct: (646) 487-6522

RE: Help with cleaning up data

2014-03-29 Thread David Lerer
not in (Select min (B.id) from icd9x10 B group by B.icd9, B.icd10). I have not tested it (sorry it is a weekend here...), but I hope it will lead you into the right direction. David. David Lerer | Director, Database Administration | Interactive | 605 Third Avenue, 12th Floor, New York, NY 10158

RE: Locking a Database (not tables) x

2014-03-23 Thread David Lerer
Thanks Shawn, This may work for us with some script changes. We'll take a look. By the way, too bad we cannot rename a database, or can we? See http://dev.mysql.com/doc/refman/5.1/en/rename-database.html about removal of a dangerous RENMAE DATABASE statement... David. David Lerer | Director

Locking a Database (not tables) x

2014-03-21 Thread David Lerer
that it will be a perfect match (object wise) to production. Is there an easy way to lock the whole database for the duration of the import - so that no developers can update the database? Obviously, I can revoke permissions, but I was wondering whether there is a better approach. Thanks, David. David Lerer

Locking a Database (not tables)

2014-03-21 Thread David Lerer
that it will be a perfect match (object wise) to production. Is there an easy way to lock the whole database for the duration of the import - so that no developers can update the database? Obviously, I can revoke permissions, but I was wondering whether there is a better approach. Thanks, David. David Lerer

RE: Locking a Database (not tables) x

2014-03-21 Thread David Lerer
Thanks Wayne. This a great idea to prevent user activity on the server. I’ll use it in the future. But I’m looking for a way to prevent user activity on a database ((i.e. database being a schema or a catalogue). David. David Lerer | Director, Database Administration | Interactive

Re: Monitoring Sessions

2012-10-10 Thread David Lerer
We have tried Oracle tool (MySQL Enterprise Monitor) which allows you to capture and analyze queries submitted from selected hosts, for a specific time window. The tool and its user interface were very useful in identifying the volume and heavy queries. Licensing and (cost) may be an issue. I

RE: How often the slave to pull data from master?

2012-07-31 Thread David Lerer
Thanks Shawn. Very informative and useful. David. The information contained in this e-mail and any attached documents may be privileged, confidential and protected from disclosure. If you are not the intended recipient you may not read, copy, distribute or use this information. If you have

RE: How often the slave to pull data from master?

2012-07-30 Thread David Lerer
Thanks Shawn. This is very useful. Could you shed some light on how rolled-back transactions (or not-yet-committed transactions for that matter) are treated as far as the binary logs? Are these updates actually go to the binary logs, thus trigger replication to the salve? Thanks, David.

RE: Subquery taking too much time on 5.5.18?

2012-07-06 Thread David Lerer
Cabbar, try to replace the IN subquery with an EXISTS. Something like: SELECT * FROM A WHERE EXISTS (SELECT * FROM B WHERE A.id=B.A_ID and B.name like 'X%'); Does it help? David. -Original Message- From: Cabbar Duzayak [mailto:cab...@gmail.com] Sent: Friday, July 06, 2012 11:46 AM

RE: create alias for columns bound to database?

2012-05-18 Thread David Lerer
Dante, consider using views that are defined with your alternate column names and present the application with these views rather than underlying table names. David. -Original Message- From: D. Dante Lorenso [mailto:da...@lorenso.com] Sent: Friday, May 18, 2012 5:22 PM To:

RE: MySQL slowlog - only in file?

2012-05-14 Thread David Lerer
Alternatively, you could use MySQL Enterprise Monitor (Oracle) and capture the queries for very easy analysis. I have found it very effective, especially when you have very high number of queries per second. I have not noticed any impact on database performance. David. -Original

RE: Deadlock due lockwait. How can I tell mysql to wait longer?

2012-05-14 Thread David Lerer
Going on a limb here...: I believe I have occurred similar issue (i.e. two transactions go into an indefinite wait).Though, very infrequent occurrence. My only explanation at that time was that there is some loophole when the deletes/inserts had some impact also on the table indexes. In

RE: MySQL slowlog - only in file?

2012-05-14 Thread David Lerer
Alternatively, you could use MySQL Enterprise Monitor (Oracle) and capture the queries for very easy analysis. I have found it very effective, especially when you have very high number of queries per second. In turning on this capture, I have not noticed any impact on database performance.

RE: how to sync mysql.user table between to two mysql instances

2012-03-16 Thread David Lerer
As a follow up question, will it be ok to do the following: 1. mysqldump -hmysql-inst2 mysql 2. Backup mysql-inst1 and use the backup to restore to mysql-inst2 3. mysql -hmysql-inst2 mysql This way I hope to be able to refresh a DEV instance from a PROD database, but preserve the permissions,

RE: how to sync mysql.user table between to two mysql instances

2012-03-16 Thread David Lerer
To: David Lerer; Baron Schwartz; MySql Subject: RE: how to sync mysql.user table between to two mysql instances Hello David, Precisely, that's what my problem is. The users found in mysqlinst1 are not in mysqlinst2. There are about 30 users defined in inst1 and only 4 in inst2. I would like to sync

RE: query problem with null

2012-03-09 Thread David Lerer
Have you tried to set city = null (i.e. without the quotes)? David. -Original Message- From: Richard Reina [mailto:gatorre...@gmail.com] Sent: Friday, March 09, 2012 4:24 PM To: mysql@lists.mysql.com Subject: query problem with null When I do the following query: SELECT * FROM

RE: preg_replace in update statement

2012-03-09 Thread David Lerer
Try with a combination of functions LOCATE and SUBSTR. Locate will return the positions for WordA and WordB within the original text, and, SUBSTR will allow you to string what you you need all together. David. On Thu, Mar 8, 2012 at 4:11 PM, Hank hes...@gmail.com wrote: I have a simple

RE: Read_only and InnoDB transactions

2011-11-28 Thread David Lerer
What version do you use? David. -Original Message- From: Viacheslav Biriukov [mailto:v.v.biriu...@gmail.com] Sent: Monday, November 28, 2011 7:09 AM To: mysql@lists.mysql.com Subject: Read_only and InnoDB transactions Hi all. From the Mysql Documentation: If you attempt to enable

RE: Read_only and InnoDB transactions

2011-11-28 Thread David Lerer
Biriukov [mailto:v.v.biriu...@gmail.com] Sent: Monday, November 28, 2011 9:20 AM To: David Lerer Cc: mysql@lists.mysql.com Subject: Re: Read_only and InnoDB transactions MySQL Community Server 5.1.59 on the Centos 5.7 2011/11/28 David Lerer dle...@us.univision.commailto:dle...@us.univision.com What

RE: Concerned : Developer getting There is no 'root'@'%' registered error message

2011-08-18 Thread David Lerer
Thanks Bier. I see what you mean. (As a rule we always use SQL SECURITY INVOKER) David. -Original Message- From: Johan De Meersman [mailto:vegiv...@tuxera.be] Sent: Thursday, August 18, 2011 4:20 AM To: David Lerer Cc: mysql@lists.mysql.com Subject: Re: Concerned : Developer getting

RE: Concerned : Developer getting There is no 'root'@'%' registered error message

2011-08-17 Thread David Lerer
Correct me if I am wrong, but my impression is that usage of DEFINER=user in stored procedures has no impact on runtime and is actually optional. (not to be confused with the clause SQL SECURITY INVOKER which is crucial.) Note: I use 5.1.32-enterprise-gpl-advanced-log. David. -- MySQL General

Re: Hungarian Notation [Was Re: Too many aliases]

2011-08-07 Thread David Lerer
I join you Arthur. That Hungarian notation is despicable (though I love listening to that language, it is different). I don't find it necessary for a column name to tell me its type. But I do like the ability to have all database objects (table, column, trigger, index, fk, views, procedures,

RE: Too many aliases

2011-08-04 Thread David Lerer
I agree. I use the same column name in all tables where it has the same function - but I consistently add a suffix or prefix. And yes, it is the old fashion way David. -Original Message- From: h...@tbbs.net [mailto:h...@tbbs.net] Sent: Thursday, August 04, 2011 8:26 AM To:

RE: Too many aliases

2011-08-03 Thread David Lerer
I rarely use aliases (unless rarely required in self-join queries). When I have that option, I create unique columns by prefixing every table (and its objects) with a number. Something like: Create table T1234_Employee (C1234_Employee_id number(5), C1234_employee_status char(1)...) Index

RE: Which is better

2011-08-02 Thread David Lerer
Hard to tell. It depends on the cardinality of tables' id (I assume the IDs are not unique in each of the tables). David. -Original Message- From: Shawn Green (MySQL) [mailto:shawn.l.gr...@oracle.com] Sent: Tuesday, August 02, 2011 2:47 PM To: Adarsh Sharma Cc: mysql@lists.mysql.com