473,394 Members | 1,960 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,394 software developers and data experts.

Simple query, still Using temporary; Using filesort ?!

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 3097

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

Similar topics

0
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,...
0
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...
0
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,...
2
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,...
1
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...
4
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,...
4
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...
0
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...
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...

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.