From: Dan Nelson Date: September 4 2006 4:23am Subject: Re: problem with InnoDB List-Archive: http://lists.mysql.com/mysql/201644 Message-Id: <20060904042323.GE93326@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Sep 04), prasad.ramisetti@stripped said: > Actually there is some requirement, where I need to know the number > of rows that I will get for my queries before actually executing the > query. Could you please suggest some way for this. Your best bet is to create an index on the smallest column you can find (maybe even create a char(1) and leave it empty), and "SELECT COUNT(*) FROM innotable USE INDEX (smallcolumn)". That way mysql only has to scan a small secondary index instead of the main table index. -- Dan Nelson dnelson@stripped