On Mon, 2008-01-14 at 17:46 +0800, joebert jacaba wrote: > Please give some pointers to speed up query to a 130 million ++ rows > mysql table. This table has 5 columns. A primary key, an account code, > an OR number, a date and a status id. I am currently indexing the > table on the account code.
what's the query? generally, you'll need an index on the column(s) in the where clause, although exactly what you're doing in the where clause can make a difference too and sometimes just having an index on the columns used in the where clause might not always help. also, explain is your friend: http://dev.mysql.com/doc/refman/5.0/en/explain.html from that page, note that after you've created relevant tables you may need to do: analyze table [tablename] to update statistics, http://dev.mysql.com/doc/refman/5.0/en/analyze-table.html note: that's for mysql 5.x. if you're using an earlier version of mysql (pre-4.1, 4.1 has explain) then read the manual pages for that version as I'm not familiar with versions before 4.1 (and even with 4.1 I prefer to stay away since it's far too primitive compared to postgresql). tiger _________________________________________________ Philippine Linux Users' Group (PLUG) Mailing List [email protected] (#PLUG @ irc.free.net.ph) Read the Guidelines: http://linux.org.ph/lists Searchable Archives: http://archives.free.net.ph

