Slow query: optimizer ignores index, using filesort

2005-06-13 Thread Scott Gifford
I'm having a hard time figuring out why a query in my application is slow. It seems that MySQL is using a filesort where it's not necessary, and as a result a query that should be taking a fraction of a second is taking up to 10 seconds. Essentially, the query is doing a join of 4 tables, two of

Re: Slow query: optimizer ignores index, using filesort

2005-06-13 Thread Jigal van Hemert
From: Scott Gifford mysql explain SELECT mirealsource_homes.mls_num, mirealsource_homes_supplemental.listdate, mirealsource_images.image1, mirealsource_homes_stats.detail_views FROM mirealsource_homes,

Optimises LEFT JOIN

2005-06-13 Thread Gyurasits Zoltn
Hello All! I have a speed problem with LEFT JOIN condition. SELECT * FROM t1 INNER JOIN t2 ON t2.c_ID=t1.ID WHERE The table2 row count is high. (100 000 records) This is correct and FAST (1-2 sec), but not good for me. Because I need all record from table1. I use this... SELECT *

Re: Optimises LEFT JOIN

2005-06-13 Thread Jigal van Hemert
From: Gyurasits Zoltn I have a speed problem with LEFT JOIN condition. (...) Why?? Somebody can help me? Tnx!! You will probably get a lot more useful response if you include the table structure, the complete query/queries and the output of EXPLAIN for each query (just put EXPLAIN in front of

Re: Thank you for delivery

2005-06-13 Thread luuk
The message contains Unicode characters and has been sent as a binary attachment. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Optimises LEFT JOIN

2005-06-13 Thread mfatene
Hi zoltan if you know difference between inner join and left join, you can conclude than maybe there are a lot of rows in table1 which do not verify you join condition. This example show you that the result is different and and add'in where clause if you want to transform the left join result

Re: Database Table Date Assistance

2005-06-13 Thread mfatene
Hi scott, you can use datetime or timestamp. Using timestamp in this example shows you that now() can be a default or inserted value. You can also use current_tiumestamp. Other functions like date_add can help you to look for rows verifying interval days like in this example : mysql create table

Re: Optimises LEFT JOIN

2005-06-13 Thread Gyurasits Zoltán
Hello! Sorry for the incomplete information... The complete select is: SELECT lt.cikk_ID, SUM(bt.mennyiseg) FROM traktar_leltartetelek_new lt LEFT JOIN traktar_mozgas_bizonylat_cikk bt ON bt.cikk_ID=lt.cikk_ID and bt.raktar_ID=01 WHERE lt.leltar_ID=000 GROUP BY lt.cikk_ID And table

Re: mysql decrypt

2005-06-13 Thread mfatene
Hi, Have you tried this ? i said the length, so you can rise it until working for tests. I used 32k and it works without any problem. I can remind that with a blob it works also : mysql create table t1( asunto varbinary(32000), asun varbinary(16) ); Query OK, 0

Re: Optimises LEFT JOIN

2005-06-13 Thread Gyurasits Zoltán
Hello Mathias! I know what is the difference between LEFT and INNER JOIN. I need the NULL records too. mysql select * from a left join b on a.id=b.id; +--+-+--+-+ | id | txt | id | txt | +--+-+--+-+ |1 | a test1 |1 | b test1

Install Mysql 4 on Fedora Core 2

2005-06-13 Thread Jerry Swanson
I want to install MySQL 4 on Fedora Core 2. Questions: #1. Do I need to uninstall MySQL 3 from the server first? #2. Where I can get source for MySQL 4? Thanks -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL

RE: Install Mysql 4 on Fedora Core 2

2005-06-13 Thread Peter Normann
Jerry Swanson wrote: #1. Do I need to uninstall MySQL 3 from the server first? Not really. #2. Where I can get source for MySQL 4? At your local 7/11. They usually store it hidden behind the counter along with the most popular nuclear launch codes. If they are out of stock, you might

Re: Install Mysql 4 on Fedora Core 2

2005-06-13 Thread Jigal van Hemert
I want to install MySQL 4 on Fedora Core 2. Questions: #1. Do I need to uninstall MySQL 3 from the server first? http://dev.mysql.com/doc/mysql/en/upgrading-from-3-23.html #2. Where I can get source for MySQL 4? http://dev.mysql.com/downloads/ Go to the page of the version you like to

mysql cygwin

2005-06-13 Thread Jan Bartholdy
I want to use a mysql database in a cygwin application (GRASS). Should I install mysql under cygwin or does exist any possibilities to use the database with myodbc under cygwin only? Thanks, Jan Virus checked by G DATA AntiVirusKit Version: AVK 15.0.5403 from 10.06.2005 -- MySQL

Re: Regarding NOT NULL Option for Table Fields....

2005-06-13 Thread mfatene
Hi ashok, With check, you could do iy, but they don't work with mysql. The only solution i ican see is an application control or : drop table if exists tempo; create table tempo like mine; insert into tempo values('',''); insert into mine select * from tempo where length(...)0; drop table tempo;

Re: mysql cygwin

2005-06-13 Thread SGreen
Jan Bartholdy [EMAIL PROTECTED] wrote on 06/13/2005 07:18:22 AM: I want to use a mysql database in a cygwin application (GRASS). Should I install mysql under cygwin or does exist any possibilities to use the database with myodbc under cygwin only? Thanks, Jan Virus checked

How to load a remote db with lots of data?

2005-06-13 Thread Brian Dunning
I have to load my remote MySQL db's with about a gig of data - phpMyAdmin only allows me to upload a 15MB CSV file, so I have to painstakingly separate my data into 15MB chunks and upload them one at a time. It's a huge pain and takes about two entire days. Is there a better solution??

Re: How to load a remote db with lots of data?

2005-06-13 Thread Peter
hi, do you have SSH access to the server ? Peter Brian Dunning wrote: I have to load my remote MySQL db's with about a gig of data - phpMyAdmin only allows me to upload a 15MB CSV file, so I have to painstakingly separate my data into 15MB chunks and upload them one at a time. It's a

Re: How to load a remote db with lots of data?

2005-06-13 Thread David Legault
You might want to try BigDump http://www.ozerov.de/bigdump.php I can't tell how it will cope with 1 GB of data though. David Brian Dunning wrote: I have to load my remote MySQL db's with about a gig of data - phpMyAdmin only allows me to upload a 15MB CSV file, so I have to painstakingly

Re: How to load a remote db with lots of data?

2005-06-13 Thread Frank Bax
At 10:00 AM 6/13/05, Brian Dunning wrote: I have to load my remote MySQL db's with about a gig of data - phpMyAdmin only allows me to upload a 15MB CSV file, so I have to painstakingly separate my data into 15MB chunks and upload them one at a time. It's a huge pain and takes about two entire

Re: How to load a remote db with lots of data?

2005-06-13 Thread Brian Dunning
On Jun 13, 2005, at 7:06 AM, Peter wrote: do you have SSH access to the server ? No. :( -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: How to load a remote db with lots of data?

2005-06-13 Thread Brian Dunning
On Jun 13, 2005, at 7:10 AM, replies-lists- [EMAIL PROTECTED] wrote: do you have shell access to the server? I see that there is some talk about uploading myshell or phpshell to the server, so it appears that that is an option. I don't know the first thing about what that is or how it

RE: How to load a remote db with lots of data?

2005-06-13 Thread Berman, Mikhail
Brian, How about an FTP service on your remote server? Mikhail Berman -Original Message- From: Brian Dunning [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005 10:01 AM To: mysql@lists.mysql.com Subject: How to load a remote db with lots of data? I have to load my remote MySQL

RE: How to load a remote db with lots of data?

2005-06-13 Thread mfatene
Hi, there is nothing simplier and faster than load data infile (LOCAL) since you can connect to the server Mathias Selon Berman, Mikhail [EMAIL PROTECTED]: Brian, How about an FTP service on your remote server? Mikhail Berman -Original Message- From: Brian Dunning

alter table - add a column

2005-06-13 Thread bruce
hi.. i have a table that i want to add a column to, and define the columm to be the primary key. however, i already have a column in the table that's used as the primary. can someone tell me the approach/commands i should use to get my results? table foo username varchar(50), primary what i

Re: How to load a remote db with lots of data?

2005-06-13 Thread Brian Dunning
On Jun 13, 2005, at 7:18 AM, Berman, Mikhail wrote: How about an FTP service on your remote server? No - I actually don't have any remote access directly to the MySQL server. My ISP has separate machines for the database servers and the web servers - I can do a lot with my web server, but

Re: alter table - add a column

2005-06-13 Thread Jigal van Hemert
From: bruce table foo username varchar(50), primary what i want... userid int(), primary username varchar(50) with userid listed before username!! can someone tell me what the commands are that i need to enter to get this!! http://dev.mysql.com/doc/mysql/en/alter-table.html ALTER TABLE

RE: How to load a remote db with lots of data?

2005-06-13 Thread Berman, Mikhail
Hi Brain, I have to believe that this task shapes to be more administrative than technical. There are number of ways to upload a file, but you need access to the MySQL server. Would it be possible for you to talk to your ISP to allow some type of remote access to MySQL server? You could

alter table - add a column

2005-06-13 Thread J.R. Bullington
Alter table foo drop Primary Key Alter table add `userid` int(8) first Alter table add Primary Key `userid` Those 3 statements should do it. However, knowing the people on this list, they will have a faster and better way than mine. Don't forget about the manual as well...

Re: alter table - add a column

2005-06-13 Thread Philippe Poelvoorde
bruce wrote: hi.. i have a table that i want to add a column to, and define the columm to be the primary key. however, i already have a column in the table that's used as the primary. can someone tell me the approach/commands i should use to get my results? table foo username varchar(50),

Re: How to load a remote db with lots of data?

2005-06-13 Thread Frank Bax
At 10:36 AM 6/13/05, Brian Dunning wrote: On Jun 13, 2005, at 7:18 AM, Berman, Mikhail wrote: How about an FTP service on your remote server? No - I actually don't have any remote access directly to the MySQL server. My ISP has separate machines for the database servers and the web servers

Re: alter table - add a column

2005-06-13 Thread Jigal van Hemert
From: Philippe Poelvoorde [Note, ALTER TABLE foo ADD userid integer unsigned NOT NULL auto_increment BEFORE username, ADD PRIMARY KEY(userid); does not seems to work, possibly a bug ? ] No, you forgot the DROP PRIMARY KEY ;-) ALTER TABLE `foo` DROP PRIMARY KEY, ADD `userid` INTEGER UNSIGNED

Re: Install Mysql 4 on Fedora Core 2

2005-06-13 Thread Gleb Paharenko
Hello. Use the rpm or binary distribution from: http://dev.mysql.com/downloads/mysql/4.1.html If you install MySQL using rpm with -U command line option, it will remove the old package. You may meet some problems using PHP or Perl when you try to connect through they was compiled for

best configuration for ip failover

2005-06-13 Thread Susan Ator
This is our situation: We have two servers running RHES3 with samba connections to a server running RHES4. (No, it's not dns. Believe me when I say I don't ever want to go through *that* pain again) Our ES4 server contains shared data that is not controlled through cvs. Our two ES3 servers contain

Re: best configuration for ip failover

2005-06-13 Thread mfatene
Hi, you can configure bin-log on one, and send logs the second server for sync. you will have an almost real-time synchronization env. problem is that you MUST use inodb for ttansactions, and apply exactly the changes to the standby server. no replication, no cluster. This is a simple but needed

Alter Column Name?

2005-06-13 Thread Scott Purcell
I cannot find any information on this, so I am thinking the answer is no. But I have a column that I would like to change the name of: current the column name isID, and I would like it to change it to CHILD_ID, as the the software is changing, and we are adding parent_id column. Thanks, Scott

Re: alter table - add a column

2005-06-13 Thread Philippe Poelvoorde
Jigal van Hemert wrote: From: Philippe Poelvoorde [Note, ALTER TABLE foo ADD userid integer unsigned NOT NULL auto_increment BEFORE username, ADD PRIMARY KEY(userid); does not seems to work, possibly a bug ? ] No, you forgot the DROP PRIMARY KEY ;-) well not really, that's the statement

CREATE TABLE and specifying DEFAULT

2005-06-13 Thread Les Schaffer
i am trying to create a table as follows: CREATE TABLE ID ( mat INT PRIMARY KEY UNIQUE, ID_firstname CHAR(35), ID_lastname CHAR(35), ID_ramqnb CHAR(12), ID_numciv_hosp CHAR(10) DEFAULT '-9', ID_appt_hosp CHAR(10) DEFAULT '-9', ID_streetname_hosp CHAR(75) DEFAULT '-9', ID_streettype_hosp CHAR(6)

Unable to install mysql

2005-06-13 Thread Yannick
Hey guys, I am not able to install properly mysql. Please see below the technical details or the bug report. The installation goes well until I try to add the root user : [EMAIL PROTECTED]:/usr/bin mysqladmin -u root -h fujitsu password x mysqladmin: connect to server at 'fujitsu' failed

RE: CREATE TABLE and specifying DEFAULT

2005-06-13 Thread Gordon Bruce
I just ran the creates on 4.0.20 on LINUX and 5.0.6 on Windows and they both seem to look fine {see the SHOW CREATE TABLE's following the CREATE TABLE statements} RUN ON 4.0.20 mysql CREATE TABLE ID ( - mat INT UNIQUE PRIMARY KEY, - ID_firstname CHAR(35) DEFAULT 'filler', -

Re: CREATE TABLE and specifying DEFAULT

2005-06-13 Thread Les Schaffer
Gordon Bruce wrote: I just ran the creates on 4.0.20 on LINUX and 5.0.6 on Windows i was running 5.0.4 on Windows: mysql \s -- mysql Ver 14.9 Distrib 5.0.4-beta, for Win32 (ia32) switching to 5.0.6 now. anyone wanna make a bet ;-) les schaffer -- MySQL General Mailing

Re: CREATE TABLE and specifying DEFAULT

2005-06-13 Thread Danny Stolle
Les Schaffer wrote: Gordon Bruce wrote: I just ran the creates on 4.0.20 on LINUX and 5.0.6 on Windows i was running 5.0.4 on Windows: mysql \s -- mysql Ver 14.9 Distrib 5.0.4-beta, for Win32 (ia32) switching to 5.0.6 now. anyone wanna make a bet ;-) les schaffer

Re: CREATE TABLE and specifying DEFAULT

2005-06-13 Thread Danny Stolle
Les Schaffer wrote: Gordon Bruce wrote: I just ran the creates on 4.0.20 on LINUX and 5.0.6 on Windows i was running 5.0.4 on Windows: mysql \s -- mysql Ver 14.9 Distrib 5.0.4-beta, for Win32 (ia32) switching to 5.0.6 now. anyone wanna make a bet ;-) les schaffer

Re: CREATE TABLE and specifying DEFAULT

2005-06-13 Thread Les Schaffer
Gordon Bruce wrote: I just ran the creates on 4.0.20 on LINUX and 5.0.6 on Windows upgrading to 5.0.6 solved the problem. do i need to let MySQL developers know about this or do they monitor the list or once a release is gone, i can assume THIS problem was fixed? thanks to all for the

Re: mysql cygwin

2005-06-13 Thread Warren Young
Jan Bartholdy wrote: I want to use a mysql database in a cygwin application (GRASS). Should I install mysql under cygwin or does exist any possibilities to use the database with myodbc under cygwin only? Thanks, Jan I believe people have gotten MySQL to build under Cygwin, but you should be

Re: mysql cygwin

2005-06-13 Thread Warren Young
[EMAIL PROTECTED] wrote: If I understand Cygwin correctly, it is a Linux shell that runs under Windows. Uh, sort of. Cygwin is a GNU environment ported to Windows. You've got your bash, your GCC, your ls, etc. To make all this work with minimal porting, there's a Cygwin DLL and library

Lower Case Problems with Win XP Pro and 5.0.6 Mysql

2005-06-13 Thread TheRefUmp
Hi, Anyone experience this problem. I did the following: C:\perlsrcmysql -f --user=root --password= --port=3307 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 48 to server version: 5.0.6-beta-nt-log Type 'help;' or '\h' for help. Type '\c' to clear

Repost: Lower Case Problems with Win XP Pro and 5.0.6 MySQL

2005-06-13 Thread TheRefUmp
Hi, Anyone experience this problem. I did the following: C:\perlsrcmysql -f --user=root --password= --port=3307 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 48 to server version: 5.0.6-beta-nt-log Type 'help;' or '\h' for help. Type '\c' to clear the

RE: alter table - add a column

2005-06-13 Thread Rhino
You'll need three alter statements: - one to add the new column - one to get rid of the old primary key - one to set the new column as the primary key Something like this, i.e. I've left out some details of the syntax: ALTER TABLE FOO ADD USERID CHAR(8); ALTER TABLE FOO DROP PRIMARY KEY; ALTER

RE: Alter Column Name?

2005-06-13 Thread Rhino
I'm not sure if this will work for a column name but there is a CHANGE COLUMN feature in the ALTER TABLE statement so that sounds promising. Then again, I don't have a MySQL system to try it on this week - I am travelling - so I can't be sure if it will work for the column name. Rhino

RE: Alter Column Name?

2005-06-13 Thread J.R. Bullington
Why not just ALTER TABLE tbl_Foo CHANGE `ID` `CHILD_ID` options go here Since I don't know the rest of your options or what you want to change the column to, that's just for the name change. J.R. -Original Message- From: Rhino [mailto:[EMAIL PROTECTED] Sent: Monday, June 13, 2005

RE: [SPAM] - Unable to install mysql - Bayesian Filter detected spam

2005-06-13 Thread Yannick
Kevin, Thanks for your answer. See below the results : * I' really wondering if there is not any missing files. * The mysql.soc file is complettly empty * I can only access myssql when I am not in root. * I can only see 1 database test when I know there is others like zorum which is working * The

RE: [SPAM] - Unable to install mysql - Bayesian Filter detected spam

2005-06-13 Thread Yannick
Kevin, In addition to that, the ZORUM database works because when I stop mysql, the following site stops working : http://www.wxy.nl/zorum_3_5/ with the database ZORUM Here PHPadmin doesn't give me any privilege to create anything : http://www.wxy.nl/phpMyAdmin/ I beleive I'm not to far from

Prevalidating queries?

2005-06-13 Thread Andy Pieters
Hi all As part of an automated patch system, I am facing the following problem: * A script will update the program from version x to version y * The script contains file actions, and database (mysql) actions * The actions are executed in order * For each action, a backup copy is created (if

RE: Prevalidating queries?

2005-06-13 Thread mathias fatene
Hi andy, Before starting your migration maake sur to stop mysql and copy all the datadir to another backup dir (just like directories). About single transaction, this will be difficult since you manage myisam tables. So what we can think to is : 1. execute one query 2. check log 3. if OK,

Re: Alter Column Name?

2005-06-13 Thread Jigal van Hemert
From: Scott Purcell I cannot find any information on this, so I am thinking the answer is no. But I have a column that I would like to change the name of: current the column name isID, and I would like it to change it to CHILD_ID, as the the software is changing, and we are adding parent_id

Re: alter table - add a column

2005-06-13 Thread Jigal van Hemert
From: Philippe Poelvoorde No, you forgot the DROP PRIMARY KEY ;-) well not really, that's the statement before ! ;-) Sorry, I misread your mail. So is that normal that I can't specify BEFORE username ? Yes, because MySQL only supports AFTER `column_name` ;-P

RE: [SPAM] - Unable to install mysql - Bayesian Filter detected spam

2005-06-13 Thread Kevin Struckhoff
Yannick, MySQL is very picky in how it handles security, or at least different. It has an extra layer of complexity, compared to say, the Informix RDBMS, which uses the OS user/password and grant statements. With that being said, have you run the post-install steps to add users to the mysql

Need Help on C with MySQL in win2000...

2005-06-13 Thread Ashok Kumar
Dear friends, I'm using win2000 with VC++. In this now i wrote one console application for invoking MySQL Database. After creating the .exe file, if i try to run that means its giving the error that can't find the specified file libmysql.dll. So i added the path of limysql.dll in env path

Re: Need Help on C with MySQL in win2000...

2005-06-13 Thread Peter Brawley
Ashok is it possible to embed that dll file with my project itself, rather than adding the path to env path var. when i'll try to run that means it never ask for the path. Is it possible? There are 3P tools which do that (Google for embed dll), but wouldn't it be simpler to put the dll in

Re: Slow query: optimizer ignores index, using filesort

2005-06-13 Thread Scott Gifford
Thanks for your response, Jigal. More below... Jigal van Hemert [EMAIL PROTECTED] writes: From: Scott Gifford [...] Apparently MySQL's optimizer sees that it can use the primary key for mirealsource_home_supplemental to do the query, but for some reason decides not to. This is often the