List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:September 4 2006 4:23am
Subject:Re: problem with InnoDB
View as plain text  
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
Thread
RE: problem with InnoDBprasad.ramisetti4 Sep
  • Re: problem with InnoDBDan Nelson4 Sep
RE: problem with InnoDBprasad.ramisetti7 Sep
  • Re: problem with InnoDBChris7 Sep
  • Re: problem with InnoDBDouglas Sims7 Sep
  • Re: problem with InnoDBDan Nelson7 Sep
    • Re: problem with InnoDBDouglas Sims7 Sep
RE: problem with InnoDBprasad.ramisetti7 Sep
  • Re: problem with InnoDBJochem van Dieten7 Sep
RE: problem with InnoDBprasad.ramisetti7 Sep
  • Re: problem with InnoDBPaul McCullagh7 Sep
    • Re: problem with InnoDBGabriel PREDA10 Sep