Re: why does "select * from table oder by indexed_field" not use key?

2012-07-10 Thread Akshay Suryavanshi
Hi, The statement will do a Full table scan, because of the following things : Not using "Where" clause, and selecting "all columns (*)" within the query. Filesort is used since no index is used, use a where clause with condition on column which is indexed and notice the explain plan. Also you can

Re: mysql failed login attempts

2012-07-15 Thread Akshay Suryavanshi
connect. Thanks Akshay Suryavanshi On Mon, Jul 16, 2012 at 8:51 AM, Tim Dunphy wrote: > hello, > > currently my php app is failing logins to it's mysql database. My config > file is set like this: > > [mysqld_safe] > general-log=1 > general-log-file=/var/log/mysqld-

Re: Temporary table creation fails

2012-09-10 Thread Akshay Suryavanshi
Hi, If you dont have data on the server, would you please initialize the data directory. Use mysql-install-db and give proper data directory and proper cnf file if you are giving so. Also specify the user as root if you have root access. Thanks On Mon, Sep 10, 2012 at 3:34 PM, Machiel Richards

Re: Temporary table creation fails

2012-09-10 Thread Akshay Suryavanshi
Hi, If you can afford try changing the tmpdir for mysql. This is a static variable and will require a mysql restart. thanks On Mon, Sep 10, 2012 at 6:08 PM, Machiel Richards - Gmail < machiel.richa...@gmail.com> wrote: > Hi > > > at the moment this does not really matter to us. > > we have

Re: checking progress of alter table on an InnoDB table (Was: Re: checking progress of alter table on a MyISAM table)

2012-09-27 Thread Akshay Suryavanshi
by adding the secondary indexes after the data import or such alters are complete. Regards, Akshay Suryavanshi On Fri, Sep 28, 2012 at 1:56 AM, Rick James wrote: > Isn't ALTER a DDL, not DML? So I don't think you would find anything in > undo logs. > > > -Origi

Re: checking progress of alter table on an InnoDB table (Was: Re: checking progress of alter table on a MyISAM table)

2012-09-27 Thread Akshay Suryavanshi
This appears to be statistics over the life of the invocation of the > server, correct? But using 405.80 inserts/s give that the alter will > take almost 79 hours. > > > > > Usually, you carry this operation by adding the secondary indexes after > the > > data import

Re: innodb_lock_wait_timeout

2012-10-11 Thread Akshay Suryavanshi
Hi, Check the transactions which are causing locks. Use show engine innodb status \G to find out the transactions acquiring locks for so long. As the scenario you mentioned (like you use innodb at simpler level), you might be in a situation where there are SELECTs causing the issue. It is strange

Re: Table crashed error

2012-10-18 Thread Akshay Suryavanshi
Hi, This table can be repaired using Repair table ; in mysql. This should fix the corrupted index file, or if mysql is shutdown, you can run myisamchk, also if its a myisam table. Hope this helps. Regards, Akshay S On Fri, Oct 19, 2012 at 11:52 AM, a bv wrote: > Hi on a log management server

Re: query running very slow, need a little help

2012-12-04 Thread Akshay Suryavanshi
Hi, A subquery with IN clause is not a good idea. If you want to tune this query, try adding indexes on the tables accessed in the inner query "credits". A composite index on (success,promoter_id) would be sufficient, then the optimizer will use this index for the where clause and as a covering in

Re: using LIMIT without ORDER BY

2012-12-12 Thread Akshay Suryavanshi
I am not sure, but if its a MyISAM table, it should be ordered by the records insertion order, and in case of InnoDB it should be ordered by the clustered index, not necessarily it should be a defined one. On Thu, Dec 13, 2012 at 12:58 PM, jiangwen jiang wrote: > hi, all: > > There's a confusion

Re: using LIMIT without ORDER BY

2012-12-13 Thread Akshay Suryavanshi
l Message - > > From: "Akshay Suryavanshi" > > > > I am not sure, but if its a MyISAM table, it should be ordered by the > > records insertion order, and in case of InnoDB it should be ordered > > by the clustered index, not necessarily it should be a def

Re: Relay log Question

2013-01-08 Thread Akshay Suryavanshi
Hi, Please re-phrase your question. The relay logs are created as and when required by the Slave_SQL thread. Once all the events in the relay logs are executed the relay log would be purged by the Slave_SQL thread. By setting relay_log_purge=0 you are disabling this automatic purge option. So the

Re: Relay log Question

2013-01-08 Thread Akshay Suryavanshi
Also, you may want to see, if at all new file is really getting every hour exactly, if any cron'd script runs, which executes "flush logs" on the slave server. That will also rotate relay log. Cheers On Wed, Jan 9, 2013 at 1:35 AM, Akshay Suryavanshi < akshay.suryavansh..

Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6

2013-02-14 Thread Akshay Suryavanshi
Mike, 5.6 is GA now, so its stable release. Also you should not jump to 5.6 directly, atleast from 5.0. There are many bug fixes and changes in 5.1, so you should consider this way. 5.0-->5.1-->5.5 (all slaves first, and then the master) And further 5.5 --> 5.6 (again all slaves first and then

Re: Upgrading form mysql 5.0.90 to 5.5 or 5.6

2013-02-15 Thread Akshay Suryavanshi
far, but it still checking, my database is > >>>>> huge so might be a while. > >>>>> > >>>>> The question I have what is the best way to fix this? > >>>>> > >>>>> To install all I did was remove all of the 5.0, and

Re: next-key lock

2014-08-28 Thread Akshay Suryavanshi
Geetanjali, There is a difference between next-key locking, gap locking and locking reads. Next-key locking and gap-locking are used with normal Selects statement in Innodb, whereas locking reads wont release a lock on the whole column until transaction completed, and not just selected values. M

Re: next-key lock

2014-09-02 Thread Akshay Suryavanshi
lect where..between > > Does above select statement will use next-key locking and/or gap locking? > I dont think so. > > Please correct me if I am wrong. > > > Best Regards, > Geetanjali Mehra > Senior Oracle and MySQL DBA Corporate Trainer an

Re: next-key lock

2014-09-03 Thread Akshay Suryavanshi
able to insert value higher than 30. > > Can you please try the same scenario at your end? > > > > > Best Regards, > Geetanjali Mehra > Senior Oracle and MySQL DBA Corporate Trainer and Database Security > Specialist > > > > On Tue, Sep 2, 2014 at 1:53 PM

Re: next-key lock

2014-09-04 Thread Akshay Suryavanshi
ted (0.00 sec) > > > > > > I tried the above scenario with index and without index. Without index > it is showing the same behaviour as before. Using non-unique index, it is > not locking the next value (20)immediately after the gap. But it is locking > a row with id=6, the

Re: purge thread

2014-09-04 Thread Akshay Suryavanshi
Hi Geetanjali, Well word of caution with this setting, it can block the whole server if the purge thread is delayed too much. Also look into other things like IO saturation or issues with disk as to why the purge thread is not able to keep up with the backlog. If IO is not the issue then there is