Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variables

2010-02-25 Thread Johan De Meersman
On Thu, Feb 25, 2010 at 8:48 AM, Dan Nelson dnel...@allantgroup.com wrote: IN is fine ( for example ... WHERE field1 IN (1,2,3,4,5,6) is extremely efficient); it's subqueries in general that are killers. If the dependent subquery is nothing but index lookups, it's still blazingly fast, though

Remove - Foreign key constraint in innodb

2010-02-25 Thread Vikram A
Hi, I tried to remove foreign key constraint in innodb table. I tried with different ways; but i am unable to drop the constraints. http://lists.mysql.com/mysql/113053 It says that, droping the foreign key constraint it is not possible in innodb engine. Is it so? or any other possibilities?

Re: Remove - Foreign key constraint in innodb

2010-02-25 Thread Jim Lyons
Yes - you can drop a foreign key constraint, use the 'alter table ... drop foreign key ...' command. If you get an error message, post the error message. On Thu, Feb 25, 2010 at 6:03 AM, Vikram A vikkiatb...@yahoo.in wrote: Hi, I tried to remove foreign key constraint in innodb table. I

Re: Remove - Foreign key constraint in innodb

2010-02-25 Thread Jesper Wisborg Krogh
An example how to delete a foreign key from an InnoDB table: test CREATE TABLE table_1 (id int unsigned NOT NULL auto_increment PRIMARY KEY) ENGINE=InnoDB; Query OK, 0 rows affected (0.56 sec) test CREATE TABLE table_2 (table1_id int unsigned NOT NULL, FOREIGN KEY (table1_id) REFERENCES

Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variables

2010-02-25 Thread Perrin Harkins
On Thu, Feb 25, 2010 at 2:48 AM, Dan Nelson dnel...@allantgroup.com wrote: IN is fine ( for example ... WHERE field1 IN (1,2,3,4,5,6) is extremely efficient); Yes, I meant to say IN/NOT IN subqueries, not value lists. it's subqueries in general that are killers. Subqueries in the FROM clause

Re: EXPLAIN says DEPENDENT SUBQUERY despite no free variables

2010-02-25 Thread Baron Schwartz
Hello, On Wed, Feb 24, 2010 at 10:11 AM, Yang Zhang yanghates...@gmail.com wrote: I have the following query. Note that the nested query has no dependencies on the outer one, yet mysql reports it as dependent. Do an EXPLAIN EXTENDED followed by SHOW WARNINGS. You will see the optimization

Re: Index analyser

2010-02-25 Thread Baron Schwartz
Bryan, On Tue, Feb 23, 2010 at 6:09 PM, Cantwell, Bryan bcantw...@firescope.com wrote: Ya, that one is helpful... just trying to land on a solution like I've seen in other DB's that have index-advisor that listens and creates what it thinks is the perfect indexes ... but thx... I know

What is unusually high for the # of connections to MySQL?

2010-02-25 Thread Jesse
I was wondering what would be considered unusually high for the # of connections to a MySQL Server? Also, if a high number of these are in sleep mode,does it make a difference? We have a web site (a few, actually) and MySQL (Version 5.0.67-community-nt-log) running on a WS08 server, and

Re: What is unusually high for the # of connections to MySQL?

2010-02-25 Thread Claudio Nanni
It depends, but 100 is not strange at all, particularly if you have sleeping connections (usually due to slow page loading (ajax?) and/or persistent connections from the app) and any number of connections cannot crash a server, can make it slow or unusable, but not crash it. Watch the app, you

Re: What is unusually high for the # of connections to MySQL?

2010-02-25 Thread Jesse
Thank you so much for the reply. I think we may have stepped outside of the MySQL realm now, but here is what I know: * At least a couple times, recycling the application pool started things right up, but that did not always work. * When this is going on, I cannot even get to a page itself,

Incorrect key file for table '...'; try to repair it on Innodb table

2010-02-25 Thread Yang Zhang
I'm getting Incorrect key file for table 'stock'; try to repair it for alter table stock add constraint pk_stock primary key (s_w_id, s_i_id);. I can't do repair table on this since it's an innodb table. Googling doesn't turn up any clear answers. Any way to recover from this, or is mysqldump +

Re: Using symlinks for database creation in mysql

2010-02-25 Thread Baron Schwartz
Hi, On Mon, Feb 22, 2010 at 10:40 AM, Johan De Meersman vegiv...@tuxera.be wrote: I don't think using a dot is a good idea - that's the table.field separator. Right. Even if mysqld didn't complain about the directory name, just try using a '.' character in an identifier. It's a syntax error,

Re: Any faster building primary/unique indexes after Load Data Infile?

2010-02-25 Thread Baron Schwartz
Hi, On Sun, Feb 21, 2010 at 1:42 PM, mos mo...@fastmail.fm wrote: I am loading 35 million rows of data into an empty MyISAM table. This table has 1 primary key (AutoInc) and 1 unique index and 2 non-unique indexes. Is it going to be any faster if I remove the indexes from the table before

Re: Re: What is unusually high for the # of connections to MySQL?

2010-02-25 Thread claudio . nanni
Hi Jesse, as you can see the most relevant is connection timed out, you could focus on this, this problem is typical of ODBC. this can happen because you use the persistent connection pool in your DSN (ODBC). So I would start focusing on the connection time out. I could say raise the

Re: Any faster building primary/unique indexes after Load Data Infile?

2010-02-25 Thread Ananda Kumar
Then before loading alter table table_name disable keys; load data alter table table enable keys; This will enable faster data load and faster index rebuild. regards anandkl On Fri, Feb 26, 2010 at 8:03 AM, Baron Schwartz ba...@xaprb.com wrote: Hi, On Sun, Feb 21, 2010 at 1:42 PM, mos

Re: Re: What is unusually high for the # of connections to MySQL?

2010-02-25 Thread Ananda Kumar
I think its more on the app side that is causing the problem. Check if the connections are getting closed on the app side after the job is done. Also u might to check on slow or general query log to know what is happening on the db side. Also check the load on the db server. We have db's

Re: Incorrect key file for table '...'; try to repair it on Innodb table

2010-02-25 Thread Ananda Kumar
This is due to less space in your /tmp file system. Change tmpdir parameter to point to a file system having more space and then try the adding the constraint. regards anandkl On Fri, Feb 26, 2010 at 5:14 AM, Yang Zhang yanghates...@gmail.com wrote: I'm getting Incorrect key file for table