# Help: bad performance

**URL:** <https://forums.percona.com/t/help-bad-performance/268>\
**Category:** Other MySQL® Questions\
**Created:** [April 2, 2007, 9:47am UTC](https://forums.percona.com/t/help-bad-performance/268 "2007-04-02T09:47:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruid](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@ruid](https://forums.percona.com/u/ruid)\
**Post date:** [April 2, 2007, 9:47am UTC](https://forums.percona.com/t/help-bad-performance/268/1 "2007-04-02T09:47:31Z")

</div>

I have two questions below:

1. The query speed is very slow, I was just wondering whether it was normal or not: My CPU is Intel Xeon Processor Dual-Core 2.4GHz and the memory is 1GB. There are 40,000 records in the database. When I deleted 150 records, the operation took 2 minutes.

2. I always encounter an error: Fatal error: Maximum execution time of 90 seconds exceeded in c:\program files\apache group\apache\htdocs\sugarcrm\include\database\MysqlManager.p hp on line 139  
Is it possible if we modify the period of maximum execution time to make it longer?  
Thanks very much in advance!

---

<div class="post-metadata">

**Author:** ![Speeple](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Speeple](https://forums.percona.com/u/Speeple)\
**Post date:** [April 3, 2007, 4:16am UTC](https://forums.percona.com/t/help-bad-performance/268/2 "2007-04-03T04:16:26Z")

</div>

Hi,

You can set the max execution time by putting the following in the top of your PHP script:

set\_time\_limit(i);

Where i is a positive integer representing the max execution time in seconds.

The delete sounds like you’re doing a DELETE with a WHERE clause with no indexes on the appropriate columns.

We’d need to see an example query to give advice on which columns to index.

Proper indexing in this case should remove the need for upping PHP’s maximum execution time.

---

<div class="post-metadata">

**Author:** ![ruid](https://avatars.discourse-cdn.com/v4/letter/r/a87d85/32.png) [@ruid](https://forums.percona.com/u/ruid)\
**Post date:** [April 3, 2007, 4:31am UTC](https://forums.percona.com/t/help-bad-performance/268/3 "2007-04-03T04:31:29Z")

</div>

Speeple，

Thanks very much for your reply!

I forgot to mention that the operation system is windows2000Server and I executed the “delete” operation in a software called SugarCRM that I never used before. So I was just wondering that the problem is because of Mysql or SugarCRM.Thanks!

---

<div class="post-metadata">

**Author:** ![Speeple](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@Speeple](https://forums.percona.com/u/Speeple)\
**Post date:** [April 6, 2007, 3:03am UTC](https://forums.percona.com/t/help-bad-performance/268/4 "2007-04-06T03:03:28Z")

</div>

Hmm [sugarcrm.com](http://sugarcrm.com) appear to be a professional org, so I would imagine they would cover things like putting suitable indexes on the database to produce fast DELETES. But given the stats you’ve posted I will still say the DELETE query isn’t utalizing indexes correct or not at all.

You should set up the MySQL slow query log and post the DELETE query that takes 2 mins here with an EXPLAIN.
