473,725 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple query, still Using temporary; Using filesort ?!

1 New Member
HI,

My query is like this:

Expand|Select|Wrap|Line Numbers
  1. SELECT tag.* FROM tag LEFT JOIN book_item ON tag.Tag_ID = book_item.BookItem_ID WHERE tag.Tag = "tags" GROUP BY tag.tag_ID
Indexes:

Expand|Select|Wrap|Line Numbers
  1. Table 'tag':
  2. Keyname      Type      Cardinality      Field
  3. PRIMARY     PRIMARY      203      Tag_ID
  4. Tag                INDEX     203        Tag
  5. Item_ID       INDEX     29      Item_ID
  6.  
  7. Table 'book_item':
  8. Keyname      Type      Cardinality      Field
  9. PRIMARY     PRIMARY     40      BookItem_ID
Explain:

Expand|Select|Wrap|Line Numbers
  1. id     select_type     table     type     possible_keys     key     key_len     ref     rows     Extra
  2. 1     SIMPLE     tag     ref     Tag     Tag     92     const     6     Using where; Using temporary; Using filesort
  3. 1     SIMPLE     book_item     eq_ref     PRIMARY     PRIMARY     4     makeliterature.tag.Tag_ID     1     Using index
My question is: how can I optimize this query to get rid of Using temporary; Using filesort ?

Thank you.
Mar 31 '08 #1
0 3126

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1090
by: Aaron Wolski | last post by:
------=_NextPart_000_0175_01C35FE2.BC685E70 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi Guys, I have 2 queries: select * FROM kcs_threadgroups AS t1, kcs_threads AS t2 WHERE
0
486
by: Jesse Sheidlower | last post by:
I'm struggling with speed issues on some queries that I would have expected to be relatively fast. Perhaps even more frustratingly, when I've tried to break these down into their components, they still execute very slowly. I've looked over all the relevant suggestions for optimization and so forth, and there's nothing I can tell that I'm missing. An example of a query is to get all the words (the cg.cw field) in a particular...
0
851
by: B | last post by:
Hello I have written the below query: select CONCAT_WS(" ",m.c_salutation, UPPER(left(m.c_firstname,1)),'&', f.c_salutation, UPPER(left(f.c_firstname,1)), f.c_lastname), ad1.ad_address1, ad1.ad_address2 from xin_contacts as m, xin_contacts as f, em_parent_child_map as m2,
2
1707
by: ensnare | last post by:
This query is running REAL slow ... like 1.2 secs ... any ideas on how I could optimize it? Perhaps my indexes are incorrect? $this->query = "SELECT m.username as username, e.title as title, e.exhibition_id as exhibition_id, LEFT(e.text,50) as text, e.random_key,
1
2054
by: Doug | last post by:
Can some one help me? I am using mysql 4.0.20a Here's the situation (I know it sounds kinda strange, but please follow me here): I'm trying to create a messaging forum. I have Forums (for example sports), within those forums, I have topics, for example "Who will win the World Series." There is another table which contains threads, within the topics. I also have a hit_counter table which has an object_id, object_type, and num_hits....
4
2510
by: Bruce D | last post by:
I have the following query that runs quickly (0.5 secs): select ZipListMatrix.ZipListMatrixID, ZipListMatrix.ZipID, ZipListMatrix.CarrierRouteID,ZipListMatrix.ListID, ZipListMatrix.Quantity,List.DisplayOrder from ZipListMatrix join List join UserList on List.ListID = UserList.ListID on ZipListMatrix.ListID = List.ListID where UserList.UserInfoID = 869
4
1637
by: Pasquale | last post by:
Is the problem with the query below in the SELECT?? Should I be using PHP to do some of things I am trying to get the SELECT to do? What is happening is it opens 3 or 4 of the same query/process and each of the process status' stay at 'Copying to tmp table', and pretty much bring down the server. Thanks! SELECT IF(se.regtype = 'i',CONCAT(p.lname,',
0
1198
by: umangjaipuria | last post by:
I have two job queues doing complimentary work and writing their output once a minute into a file. The files for each minute have to processed in pairs - one from the first job queue and one from the second and the results are merged and delivered to the final client. The filename and other details of these files go in to a MySQL database - a different table for each job queue. The merging process has to read the two files for that minute...
0
1990
by: plaidthermos | last post by:
hello, i have a database where there is a main table, documents, and then a relationship table doc_topics with one entry for each topic into which a document falls. (any document may have an arbitrary number of topics, but always at least one.) this structure is repeated for other relationships such as doc_states, doc_types, et cetera. i want a query that uses one or more of the relationships as search criteria (example, return only...
0
8872
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8747
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
9246
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
8069
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5997
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
4505
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...
0
4773
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3211
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2619
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.