473,796 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
(NewEstimatedIn come,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,NewEstima tedIncome 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
(NewEstimatedIn come,State) where 1=1 and ( (State = 'OH') ) and (
(NewEstimatedIn come >= '030' and NewEstimatedInc ome <= '039') );

id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE kbm ref State,NewEstima tedIncome 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 1311

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

Similar topics

12
1376
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 name is this code fragment intending? (In English prose if possible). It looks like a fragment from a language called "scheme" (define (this n)
4
18539
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 name="htmlref"> <AREA shape="rect" coords="1,1,10,20" href="index.html"> <AREA shape="circle" coords="50,50,10" href="toc.html"> <AREA shape="poly" coords="20,1,40,1,30,20" href="banner.html"> </MAP> <IMG src="htmlref.jpg"...
2
1845
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 your code Fields - basically just a variable but can be "write protected" Properties - access fields, they can retrieve data contained in the "variable"
7
2363
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, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages. I've had a problem separating them from the intranet HTML and ASP pages, which is...
3
2305
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 id="valValidEmail" runat="server" ControlToValidate="txtEmail" ValidationExpression="^(+)(\.+)*@(+)(\.+)*(\.{2,4})$"
18
2201
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 inserted/deleted at the end and at beginning and the std::list can have data inserted/deleted anywhere. But how can those differences be physically understood?
9
2360
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 = CDec(txbInv.Text) Wage = CDec(txbTotWage.Text)
8
1824
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 have not read the same C++ books that I have read. This kind of people has written some parts of the code that use notations that I am not familiar with (and that probably also includes also 50 % of other C ++ programmers). While everybody who...
2
7644
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 mentioning the class members(functions, typedefs, data) under the access control labels : public, protected, private. Encapsulation means providing the implementation of class member
0
9529
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10013
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.