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
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
(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
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
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
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
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
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
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
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
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
> 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
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 |
; -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
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',
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
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.
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
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
19 matches
Mail list logo