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

Using filesort

Hi,

I am having trouble optimizing the query:

select * from article order by article_id;

for a MyISAM table that looks like this:

CREATE TABLE `article` (
`id` int(11) NOT NULL auto_increment,
`thumburl` varchar(255) default NULL,
`thumb` text,
`descr` text,
`news_group_id` int(11) default NULL,
`picurl` varchar(255) default NULL,
`article_id` int(11) NOT NULL default '0',
`size` varchar(20) default NULL,
PRIMARY KEY (`id`),
KEY `index1` (`article_id`),
KEY `index2` (`id`)
);

If I do an "explain select * from article order by article_id" it says
"Using filesort" and I can not understand why in the world it is not using
index1.

Any ideas? Right now I'm using the 4.0.15-nt, but I have also tried this in
the 4.1 tree with the same results. I have also tried using "FORCE INDEX".

Any help will be much appreciated.

Kind regards
//Jan Persson
Jul 19 '05 #1
0 2204

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

Similar topics

0
by: Partap Davis | last post by:
I asked this a couple days ago, but never got an answer, so I'll try to include some more detail: MySQL 4.0.12 on linux 2.4.18... I'm doing a join on 2 tables and trying to optimize it but I...
0
by: Tom O'Neill | last post by:
Could anyone tell me the difference between the following two explains? It seems the first takes longer to execute. This first query is like so... select m.*, mi.age from members m,...
0
by: Jan Persson | last post by:
Hi, I am having trouble optimizing the query: select * from article order by article_id; for a MyISAM table that looks like this: CREATE TABLE `article` ( `id` int(11) NOT NULL...
3
by: Sven Reifegerste | last post by:
Hi, i have a table with INT columns id,key,b1,b2,c1,c2, having 1.500.000 rows. 'key' and 'id' are indexed (Kardinality 385381) and id (Kardinality 1541525). Performing a SELECT * FROM...
2
by: rawCoder | last post by:
Hi All, I have a *.cer file, a public key of some one and I want to encrypt some thing using this public key. Can someone point me to a sample code for Encrypting some file using...
1
by: Mike | last post by:
When trying to compile (using Visual Web Developer 2005 Express Beta; frameworkv2.0.50215 ) the source code below I get errors (listed below due to the use of ICallBackEventHandler. Ultimately I...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
0
by: stacionari | last post by:
HI, My query is like this: 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: Table 'tag': Keyname Type...
2
by: brainstech | last post by:
Hello, I have 3 tables tableA has info regarding name and clientid tableB has info regarding the orderids of the clients tableC has info regarding the tradeids of the clients And all the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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,...

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.