Re: select does too much work to find rows where primary key does not match

2008-04-16 Thread Joerg Bruehe
Hi Patrick, all ! Patrick J. McEvoy wrote: I have two MyISAM tables; each uses 'phone' as a primary key. Finding rows where the primary keys match is efficient: mysql> explain select bar.phone from foo,bar where foo.phone=bar.phone; [[...]} Ok, let us take some simple example. Say tables "f

Re: select does too much work to find rows where primary key does not match

2008-04-15 Thread Patrick J. McEvoy
> I would have thought your not = though is matching a lot more rows every > time.. The field is UNIQUE PRIMARY KEY in both tables, so there should be 0 or 1 matches. > I would look into using where not exists as a subselect My MySQL book (O'Reilly second edition) does not mention subqueries or

Re: select does too much work to find rows where primary key does not match

2008-04-15 Thread ddevaudreuil
How about using a left outer join. Find all the rows in bar without a matching row in foo: To verify: select * from bar left outer join foo on bar.phone=foo.phone where foo.phone is null Then delete bar.* from bar left outer join foo on bar.phone=foo.phone where foo.phone is null Phil <[EMA

Re: select does too much work to find rows where primary key does not match

2008-04-15 Thread Phil
I would have thought your not = though is matching a lot more rows every time.. I would look into using where not exists as a subselect delete from bar where not exists (select 'y' from foo where foo.phone = bar.phone); something like that. On Tue, Apr 15, 2008 at 5:00 PM, Patrick J. McEvoy <[E

select does too much work to find rows where primary key does not match

2008-04-15 Thread Patrick J. McEvoy
I have two MyISAM tables; each uses 'phone' as a primary key. Finding rows where the primary keys match is efficient: mysql> explain select bar.phone from foo,bar where foo.phone=bar.phone; ++-+---++---+- +-+---+---+--

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-08-01 Thread mos
At 12:55 PM 8/1/2004, Keith Thompson wrote: Hey Mike, Thanks again for your suggestions. I understand (and agree) with your comments about a clean shutdown. I'm always careful to do that. In this case, the mysql server has only been shutdown a couple times and it was a clean shutdown in each case.

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-08-01 Thread Keith Thompson
Hey Mike, Thanks again for your suggestions. I understand (and agree) with your comments about a clean shutdown. I'm always careful to do that. In this case, the mysql server has only been shutdown a couple times and it was a clean shutdown in each case. You suggest running table checks daily.

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-08-01 Thread mos
At 01:21 AM 8/1/2004, Keith Thompson wrote: Thanks Mike, I've always ignored CHECK TABLE because I always thought it was just for MyISAM. I ran CHECK TABLE. It told me that my table was corrupt. I then dumped the table with mysqldump and recreated it. After that CHECK TABLE said it was OK (and i

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-08-01 Thread Keith Thompson
Hi Sergei, I did come from 4.0.17 to 4.1.3 with a complete dump/reload. Then, all changes after that forward came via replication. I didn't read anything about corruption problems as a replication slave. -keith >Hi! >On Aug 01, Keith Thompson wrote: >> Thanks Mike, >> >> I've always ignored CH

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-08-01 Thread Sergei Golubchik
Hi! On Aug 01, Keith Thompson wrote: > Thanks Mike, > > I've always ignored CHECK TABLE because I always thought it was > just for MyISAM. > > Then, I decided to run CHECK TABLE on all my tables (which for the > ones with 125 million rows will probably be running for a while). > The problem now

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-07-31 Thread Keith Thompson
Thanks Mike, I've always ignored CHECK TABLE because I always thought it was just for MyISAM. I ran CHECK TABLE. It told me that my table was corrupt. I then dumped the table with mysqldump and recreated it. After that CHECK TABLE said it was OK (and in comparing values with the master server

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-07-31 Thread mos
At 07:07 PM 7/31/2004, you wrote: Hi Marc, Thanks for you response. In answer to your questions, there are no embedded newlines and I did look at index issues. I did not try rebuilding the index, which would be easy to do in this case since the tables are small (unlike a couple of my other tables

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-07-31 Thread Keith Thompson
Hi Marc, Thanks for you response. In answer to your questions, there are no embedded newlines and I did look at index issues. I did not try rebuilding the index, which would be easy to do in this case since the tables are small (unlike a couple of my other tables that have 125+ million rows and

Re: InnoDB 4.1.3: count(*) and number of rows does not match

2004-07-31 Thread Marc Slemko
On Sat, 31 Jul 2004 17:50:38 -0500, Keith Thompson <[EMAIL PROTECTED]> wrote: > I just discovered that two of my tables (out of about 300) > show a very unusual behavior. This is that "select count(*) ..." > and selecting all the rows and counting them do not produce > the same number. > > This

InnoDB 4.1.3: count(*) and number of rows does not match

2004-07-31 Thread Keith Thompson
I just discovered that two of my tables (out of about 300) show a very unusual behavior. This is that "select count(*) ..." and selecting all the rows and counting them do not produce the same number. This is on MySQL 4.1.3 on Solaris9. Look at this: $ mysql -e "select count(*) from pstat.plist

% does not match the mysql host in mysql.user table

2003-02-18 Thread ewestbrook
GRANT USAGE ON *.* TO [EMAIL PROTECTED] >Submitter-Id: >Originator: >Organization: Apple >MySQL support: none >Synopsis: % does not match the mysql host in mysql.user table >Severity: non-critical >Priority: low >Category: mysql >Class

RE: Does not match

2001-06-22 Thread Johnson, Gregert
To: mysql Subject: Does not match Can I show records from my SQL statement where records both have a match and do NOT have a match. I'm having trouble with the syntax for "no matching records" in a related table, my current SQL

Does not match

2001-06-22 Thread Dave Carter
Can I show records from my SQL statement where records both have a match and do NOT have a match. I'm having trouble with the syntax for "no matching records" in a related table, my current SQL statment looks like this: SELECT fid,Family_Last_Name,Phone FROM familytable,playertable WHERE player

Re: Documents & Spesifications Does Not Match

2001-03-27 Thread Miguel Angel Solórzano
At 20:47 27/03/2001 +0300, Yusuf Incekara wrote: Hi! Actually the MySQL Win32 distribution doesn't provides yet, the binaries and the source for BDB and Innobase stuffs. However if you want to build yourself a MySQL server with the support of BDB tables, below the instructions to build a server f

Documents & Spesifications Does Not Match

2001-03-27 Thread Yusuf Incekara
Tha instructions on mysql web pages , downloaded documents and relelased product versions are not the same for Windows. I still could not understand did 3.23.35a or 3.23.36 support bdb on windows and if supports how can i implement this. Regards.