Re: Inefficient query processing?

2008-02-11 Thread Perrin Harkins
On Feb 10, 2008 5:30 PM, Yves Goergen [EMAIL PROTECTED] wrote: My problem is that the sub-select in line 7 (SELECT 1) takes a rather long time. (When I remove it, it's much faster.) This is a known issue with EXISTS/NOT EXISTS subqueries in MySQL, which has some fixes slated for MySQL 6. In

Re: Inefficient query processing?

2008-02-11 Thread Yves Goergen
On 11.02.2008 19:51 CE(S)T, Perrin Harkins wrote: On Feb 10, 2008 5:30 PM, Yves Goergen [EMAIL PROTECTED] wrote: My problem is that the sub-select in line 7 (SELECT 1) takes a rather long time. (When I remove it, it's much faster.) This is a known issue with EXISTS/NOT EXISTS subqueries in

Query two different databases for differences

2008-02-11 Thread James Eaton
I have two different databases on the same 5.0 server that have the same tables and structure. They also have very nearly the same data. For one of the tables I'd like to run a query to find the records that are present in one database but not the other. Is this possible and what would such

Re: Inefficient query processing?

2008-02-11 Thread Peter Brawley
Yves Is there some way to get only the headlines ... For brief discussion some examples see 'The [Not] Exists query pattern' at http://www.artfulsoftware.com/infotree/queries.php. PB Yves Goergen wrote: On 11.02.2008 19:51 CE(S)T, Perrin Harkins wrote: On Feb 10, 2008 5:30 PM, Yves

Re: Inefficient query processing?

2008-02-11 Thread Perrin Harkins
On Feb 11, 2008 4:46 PM, Yves Goergen [EMAIL PROTECTED] wrote: Thank you for the link. Is there some way to get only the headlines and a summary for all entries? Reading through the entire contents by month and finding the misleading captions is hard work for such masses of content. The search

Re: Inefficient query processing?

2008-02-11 Thread Peter Brawley
Yves If user.additionalkeylist and tag.readaccesskeylist are not lists, naming them `...list` misleads distracts. You asked earlier how to fit my preliminary solution into your problem. The answer is to (i) write the query that lists access-denied messages, then (ii) write a simple

Re: Inefficient query processing?

2008-02-11 Thread Peter Brawley
Yves, Okay. Then the long form. 1. user.additionalkeylist and tag.readaccesskeylist are atomic despite their names? 2. You have reciprocal foreign keys, keylist.key referencing user(userID) and user.additionalkeylist referencing keylist.keylistID? PB Yves Goergen wrote: On 11.02.2008

MySQL University session on February 14

2008-02-11 Thread Stefan Hinz
Hi, this Thursday, Iggy Galarza will give a MySQL University session: http://forge.mysql.com/wiki/Building_MySQL_on_Windows Please register for this session by filling in your name on the session Wiki page. Registering is not required but appreciated. That Wiki page also contains a section to

Re: Query two different databases for differences

2008-02-11 Thread Peter Brawley
James; This finds common rows. Eh!? ... HAVING COUNT(*)=1 returns ONLY pairs that are different: drop table if exists a,b; create table a(i int,j int,k int); insert into a values(1,10,100),(2,20,200),(3,30,300); create table b select * from a; update b set k=301 where k=300; select * from a;

Re: Inefficient query processing?

2008-02-11 Thread Yves Goergen
On 11.02.2008 20:13 CE(S)T, Peter Brawley wrote: If user.additionalkeylist and tag.readaccesskeylist are not lists, naming them `...list` misleads distracts. Well, these fields contain KeylistId values from the keylist table, so I thought naming them *Keylist would be good enough. But on

Re: MySQL 5 on OS X Leopard

2008-02-11 Thread Grant Limberg
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I found this a while back and it seems to work just fine. It uses launchd rather than the old /Library/StartupItems folder http://blog.tomatocheese.com/archives/2007/11/1/migrating_mysql_to_mac_os_x_leopard/ Regards, Grant Limberg [EMAIL

Re: Inefficient query processing?

2008-02-11 Thread Yves Goergen
On 11.02.2008 17:32 CE(S)T, Peter Brawley wrote: 1. user.additionalkeylist and tag.readaccesskeylist are atomic despite their names? Yes, I forgot the types. Everything is scalar, varchar or integer. There are not set or otherwise complex data types. 2. You have reciprocal foreign keys,

view irregularities

2008-02-11 Thread Lev Lvovsky
I'm running into a difficult to reproduce problem with a view which is similar to the following: CREATE TABLE Common ( COMMON_ID INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, COMMON_NAME VARCHAR(50), UNIQUE(COMMON_NAME) ) ENGINE = InnoDB; CREATE TABLE Parent ( PARENT_ID

Re: finding duplicate key

2008-02-11 Thread Grant Limberg
Something like this should help you find all of the dupes select email_address from table group by email_address having count(*)1; On Feb 11, 2008 4:23 PM, Ferindo Middleton [EMAIL PROTECTED] wrote: I have a table (customers) without a primary key. I want to make the email_address field the

Re: Query two different databases for differences

2008-02-11 Thread James Eaton
From: Peter Brawley I'd like to run a query to find the records that are present in one database but not the other. See 'Compare data in two tables' at http://www.artfulsoftware.com/infotree/queries.php. Thanks. That's a start. SELECT MIN(TableName) as TableName, id, col1, col2, col3,

finding duplicate key

2008-02-11 Thread Ferindo Middleton
I have a table (customers) without a primary key. I want to make the email_address field the primary key, only problem is, several records already share the same email_address How do I write a query which will show me all the instances where email_address is duplicated throughout the table. --

Re: Inefficient query processing?

2008-02-11 Thread Yves Goergen
On 11.02.2008 00:29 CE(S)T, Peter Brawley wrote: message (messageID) keylist (keylistID) tag ( tagID, readaccesskeylist references keylist(keylistID) ) message_revision_tag ( ???, messageID references message(messageID), tagID references tag(tagID)) Another table: message_revision(MessageId

MySQL 5 on OS X Leopard

2008-02-11 Thread Unnsse Khan
Hello there, I am having problems running MySQL 5 on OS X Leopard... Nothing happens when I try to start MySQL in System Preferences. From the command line, this is the error I receive (when trying to start MySQL): ERROR 2002 (HY000): Can't connect to local MySQL server through socket

Re: Query two different databases for differences

2008-02-11 Thread BJ Swope
On Feb 11, 2008 7:27 PM, James Eaton [EMAIL PROTECTED] wrote: SELECT MIN(TableName) as TableName, id, col1, col2, col3, ... FROM ( SELECT 'Table a' as TableName, a.id, a.col1, a.col2, a.col3, ... FROM a UNION ALL SELECT 'Table b' as TableName, b.id, b.col1, b.col2, b.col3, ... FROM

Send INSERT statement from MS SQL SERVER to MySQL

2008-02-11 Thread Mário Gamito
Hi, Is it possible to send an INSERT statement from a Windows server running MS SQL SERVER 2005 to a Linux box running MySQL ? If so, how ? Do I need any special tools ? Any help would be appreciated. Warm Regards, Mário Gamito -- MySQL General Mailing List For list archives:

Re: Inefficient query processing?

2008-02-11 Thread Yves Goergen
On 11.02.2008 11:18 CE(S)T, Peter Brawley wrote: Unclear. Okay. Then the long form. My application is a messaging application that supports multiple users, messages with revisions, tags and access control. A user is identified by a UserId which I also call key. (Imagine it like the key

Re: stored procedure, parameter type help needed

2008-02-11 Thread Magne Westlie
Jerry Schwartz wrote: SELECT user_id, user_name FROM user_test WHERE user_id IN (SELECT uid FROM temp_uids); [JS] Couldn't you replace the WHERE user_id IN (SELECT uid FROM temp_uids) with a simple JOIN? If IN is badly optimized, as I've read here, wouldn't that be more efficient? Or am I

Re: Query two different databases for differences

2008-02-11 Thread Peter Brawley
James I'd like to run a query to find the records that are present in one database but not the other. See 'Compare data in two tables' at http://www.artfulsoftware.com/infotree/queries.php. PB James Eaton wrote: I have two different databases on the same 5.0 server that have the same

Re: Inefficient query processing?

2008-02-11 Thread Peter Brawley
Yves it will rather find messages that have no tag with a keylist which does not include the currently logged in user's UserId or one of this user's additional keys, which are again stored in a keylist. Unclear. PB Yves Goergen wrote: On 11.02.2008 00:29 CE(S)T, Peter Brawley wrote: message