MySQL University session on February 4: Optimizing Queries with EXPLAIN

2010-02-02 Thread Stefan Hinz
MySQL University: Optimizing Queries with EXPLAIN http://forge.mysql.com/wiki/Optimizing_Queries_with_Explain This Thursday (February 4th, 14:00 UTC), Morgan Tocker will talk about Optimizing Queries with Explain. Morgan was a technical instructor at MySQL and works for Percona today. For MySQL

Re: Optimizing Queries (specifically with LIMIT)

2004-05-30 Thread Daniel Clark
I found it interesting. Thanks Eric. >>(reconstructed from archives i accidentally deleted the copy in my mailbox >>>Daniel Clark writes: >>>I don't see how LIMIT would make a difference. LAST_INSERT_ID() only >>>returns one record. >>>But it's worth trying in a big loop to get timing numbers

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Eric Absgarten
(reconstructed from archives i accidentally deleted the copy in my mailbox Daniel Clark writes: I don't see how LIMIT would make a difference. LAST_INSERT_ID() only returns one record. But it's worth trying in a big loop to get timing numbers. Well, I decided to test this all out and see what ha

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Daniel Clark
I don't see how LIMIT would make a difference. LAST_INSERT_ID() only returns one record. But it's worth trying in a big loop to get timing numbers. >>I have a rather simple straightforward question that I was not able to find >>in any of the documentation. >>I am in the process of writing an

Re: Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Michael Stassen
LAST_INSERT_ID is connection-specific, not table-specific. When you say, SELECT LAST_INSERT_ID() FROM foo; you are asking for the LAST_INSERT_ID to be repeated once for each row of table foo. This is analogous to SELECT NOW() FROM foo; or SELECT 2 FROM foo; Adding a LIMIT would work, but

Optimizing Queries (specifically with LIMIT)

2004-05-29 Thread Eric Absgarten
Hello, I have a rather simple straightforward question that I was not able to find in any of the documentation. I am in the process of writing an application, and I was wonder whether there is any benefit (or penalty) in LIMIT(ing) a LAST_INSERT_ID() query? i.e. SELECT LAST_INSERT_ID() FROM foo

Re[2]: Optimizing Queries

2004-03-09 Thread Richard Davey
Hello Chris, Wednesday, March 10, 2004, 12:48:02 AM, you wrote: CF> Thanks for the email. I created a multi-field index using the fields that CF> are in the query and the query only took 0.91 seconds. That's better than 9 CF> minutes and definitely under 30 seconds. Glad to hear it. Farewell MSS

RE: Optimizing Queries

2004-03-09 Thread Donny Simonton
OTECTED] > Subject: RE: Optimizing Queries > > Rich, > > Thanks for the email. I created a multi-field index using the fields that > are in the query and the query only took 0.91 seconds. That's better than > 9 > minutes and definitely under 30 seconds. > > T

RE: Optimizing Queries

2004-03-09 Thread Chris Fossenier
Sent: Tuesday, March 09, 2004 11:00 AM To: [EMAIL PROTECTED] Subject: Re: Optimizing Queries Hello Chris, Tuesday, March 9, 2004, 4:38:00 PM, you wrote: CF> I'm trying to determine the best way to optimize the query below. CF> Right now it is taking around 9mins and we need it to take n

Re[2]: Optimizing Queries

2004-03-09 Thread Richard Davey
Hello Chris, Tuesday, March 9, 2004, 6:15:56 PM, you wrote: CF> Why does it only use the one index? It will evaluate the best index to use for the query and if all you have are single-field indexes, it can only select one of those. From the MySQL manual: "If a multiple-column index exists on c

RE: Optimizing Queries

2004-03-09 Thread Chris Fossenier
Why does it only use the one index? Chris. -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 09, 2004 11:00 AM To: [EMAIL PROTECTED] Subject: Re: Optimizing Queries Hello Chris, Tuesday, March 9, 2004, 4:38:00 PM, you wrote: CF> I'm t

RE: Optimizing Queries

2004-03-09 Thread Erich Beyrent
> Chris, > Is it faster if you remove the 'IS NOT NULL'? I know that's not the > > results > you want, but we have found that is NOT NULL will do a full scan. But we > normally use it with a join. Since you are using one table, I'm not sure > how it would affect it. > > Donny This is an intere

Re: Optimizing Queries

2004-03-09 Thread Richard Davey
Hello Chris, Tuesday, March 9, 2004, 4:38:00 PM, you wrote: CF> I'm trying to determine the best way to optimize the query below. Right now CF> it is taking around 9mins and we need it to take no more than 30 seconds (we CF> can get it under 30s on MS SQL): CF> | 1 | SIMPLE | speedlink |

RE: Optimizing Queries

2004-03-09 Thread Donny Simonton
; -Original Message- > From: Chris Fossenier [mailto:[EMAIL PROTECTED] > Sent: Tuesday, March 09, 2004 10:38 AM > To: [EMAIL PROTECTED] > Subject: Optimizing Queries > > Hello, > > I'm trying to determine the best way to optimize the query below. Right > now > it is

Optimizing Queries

2004-03-09 Thread Chris Fossenier
Hello, I'm trying to determine the best way to optimize the query below. Right now it is taking around 9mins and we need it to take no more than 30 seconds (we can get it under 30s on MS SQL): explain select count(distinct(phone)) as TOTAL FROM speedlink WHERE county in('247','085','145','285',

Help optimizing queries

2003-02-19 Thread Jesse Sheidlower
I have a database that I've worked hard to set up, and while many of my queries are working well, I have a few that are proving to be extremely slow, despite my best efforts to properly index them. I'd be grateful for any advice on how to speed these up, or an explanation of how there's no way to

Optimizing queries

2001-10-26 Thread David Wolf
I have a query as follows: SELECT log.entity, log.action, LEFT(users.username,10) AS username, LEFT(boards.title,15) AS Board, LEFT(topics.subject,22) as Subject, log.postid, log.extraid, LEFT(from_unixtime(log.logtime),19) AS time, log.ip FROM log LEFT JOIN users ON log.userid = users.

Re: Optimizing Queries

2001-02-19 Thread Tõnu Samuel
Jim Bayers wrote: > > I have a non-profit site that uses mysql. I need to optimize two queries so > they won't put such a load on the mysql server. If I don't lighten the > load, they've treatened to kick us off. Check the manual chaper about optimizations, especially about EXPLAIN command. Th

Optimizing Queries

2001-02-19 Thread Jim Bayers
I have a non-profit site that uses mysql. I need to optimize two queries so they won't put such a load on the mysql server. If I don't lighten the load, they've treatened to kick us off. What columns are best to index? SELECT messages.ID as ID, title, text, user_id, username, email FRO