473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Understanding Explain?

I'm trying to understand MySQL better. I can't seem to figure out why the
second query takes 2 minutes and the first query takes 12 seconds. It
should be noted that the table, KBM, has 250 million records. I'm using
MySQL 5.0.2.
I guess I'm trying to get a better understanding of what "using index" means
in the "extra" column.

Here's the result of the explain on my first query:
SQL-query: explain Select count(1) as counter from kbm force index
(NewEstimatedIncome,State) where 1=1 and ( (State = 'OH') )

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE kbm ref State,NewEstimatedIncome State 2 const 7958721 Using where,
Using index
Here's the result of the explain on my second query:
SQL-query: explain Select count(1) as counter from kbm force index
(NewEstimatedIncome,State) where 1=1 and ( (State = 'OH') ) and (
(NewEstimatedIncome >= '030' and NewEstimatedIncome <= '039') );

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE kbm ref State,NewEstimatedIncome State 2 const 7958721 Using where

Any information is appreciated.
Anywhere I can read more about this stuff...besides mysql.com?

TIA
-bruce duncan

Jul 23 '05 #1
0 1288

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Fran | last post by:
I'm trying to understand a functional language code fragment so I can explain its syntax and workings to my non English-speaking background neighbour, who is doing her finals. What in heaven's...
4
by: Johnny Paredes | last post by:
hello. i'm new to html so please forgive my silly question. i'm just having a little trouble understanding the map and area tags. i'm going to use this basic example to explain my question - <MAP...
2
by: Mike | last post by:
Hey guys, need some help understanding some things that maybe someone can explain or clarify it a little better then a text book. Here is my understanding so far: Class - basically a shell for...
7
by: laura | last post by:
I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore,...
3
by: Joe | last post by:
Hi, I have been using a regular expression that I don’t uite understand to filter the valid email address. My regular expression is as follows: <asp:RegularExpressionValidator...
18
by: Simon | last post by:
Hi, I understand what one the differences between std::vector, std::deque and std::list is, the std::vector can have data inserted/deleted at the end. The std::deque can have data...
9
by: Rudy | last post by:
Hello All! I'm a little confused on Public Class or Modules. Say I have a this on form "A" Public Sub Subtract() Dim Invoice As Decimal Dim Wage As Decimal Static PO As Decimal Invoice =...
8
by: boki_pfc | last post by:
Hi Everybody, I am looking for an advice on following: I have that "pleasure" of reading C++ codes that have been written by person(s) that have not attended the same C++ classes that I did or...
2
by: subramanian100in | last post by:
Is my following understanding correct ? Data abstraction means providing the interface - that is, the set of functions that can be called by the user of a class. Information hiding means...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.