List:General Discussion« Previous MessageNext Message »
From:<prasad.ramisetti Date:September 7 2006 4:29am
Subject:RE: problem with InnoDB
View as plain text  
Hi Dan,

Thanks for yur response. Does it makes sense to create an index on a
primary key ..as that is my smallest field ?

Regards
Prasad

-----Original Message-----
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.

--
	Dan Nelson
	dnelson@stripped


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.

www.wipro.com
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