Thanks for yur response. Does it makes sense to create an index on a
primary key ..as that is my smallest field ?
From: Dan Nelson [mailto:dnelson@stripped]
Sent: Monday, September 04, 2006 9:53 AM
To: Prasad Ramisetti (WT01 - Broadband Networks)
Cc: dmagick@stripped; mysql@stripped
Subject: Re: problem with InnoDB
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.
The information contained in this electronic message and any attachments to this message
are intended for the exclusive use of the addressee(s) and may contain proprietary,
confidential or privileged information. If you are not the intended recipient, you should
not disseminate, distribute or copy this e-mail. Please notify the sender immediately and
destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this
email and any attachments for the presence of viruses. The company accepts no liability
for any damage caused by any virus transmitted by this email.