Re: combined or single indexes?

2010-07-22 Thread Shawn Green (MySQL)
On 7/21/2010 1:02 PM, Tompkins Neil wrote: Hi So Just running a basic query I get returned the following : table,type,possible_keys,key,key_len,ref,rows,Extra, Products,ALL,9884,where used, Therefore, I assume *ALL* is the worst possible type and should look at adding a an index to this

Re: combined or single indexes?

2010-07-22 Thread Tompkins Neil
Thanks for your reply, and sorry for not verifying in the manual. Another couple of questions I have : If I run a EXPLAIN query and SELECT against a primary key and SELECT fields which are not indexed, I assume that returned EXPLAIN statement as below, means I don't need to index additional

RE: combined or single indexes?

2010-07-22 Thread Jerry Schwartz
-Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, July 22, 2010 3:39 PM To: Shawn Green (MySQL) Cc: mysql@lists.mysql.com Subject: Re: combined or single indexes? Thanks for your reply, and sorry for not verifying in the manual. Another couple

Re: combined or single indexes?

2010-07-22 Thread Tompkins Neil
- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, July 22, 2010 3:39 PM To: Shawn Green (MySQL) Cc: mysql@lists.mysql.com Subject: Re: combined or single indexes? Thanks for your reply, and sorry for not verifying in the manual. Another couple of questions I have

RE: combined or single indexes?

2010-07-22 Thread Jerry Schwartz
From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, July 22, 2010 4:50 PM To: Jerry Schwartz Cc: Shawn Green (MySQL); mysql@lists.mysql.com Subject: Re: combined or single indexes? Thanks for the information Jerry. Just to confirm, you mentioned if you only need one

Re: combined or single indexes?

2010-07-22 Thread Neil Tompkins
@lists.mysql.com Subject: Re: combined or single indexes? Thanks for the information Jerry. Just to confirm, you mentioned if you only need one key then you only need one key. My question was that this particular query was using SELECT against a primary key and other fields which

Re: combined or single indexes?

2010-07-21 Thread Tompkins Neil
Hi So Just running a basic query I get returned the following : table,type,possible_keys,key,key_len,ref,rows,Extra, Products,ALL,9884,where used, Therefore, I assume *ALL* is the worst possible type and should look at adding a an index to this particular field ? Cheers Neil On Fri, Jul

Re: combined or single indexes?

2010-07-09 Thread mos
At 12:43 AM 7/9/2010, you wrote: On Fri, Jul 9, 2010 at 7:30 AM, Neil Tompkins neil.tompk...@googlemail.comwrote: Should we be looking to create a index for all fields that we might be perform a select condition in a where clause for ? Neil, Keep in mind that the more indexes you add

Re: combined or single indexes?

2010-07-08 Thread Neil Tompkins
@lists.mysql.com Sent: Tuesday, July 06, 2010 6:41 PM Subject: combined or single indexes? Is there a benefit to a combined index on a table? Or is multiple single column indexes better? If I have table 'foo' with columns a, b, and c. I will have a query like: select c from foo where a in (1,2,3

Re: combined or single indexes?

2010-07-08 Thread Johan De Meersman
:41 PM Subject: combined or single indexes? Is there a benefit to a combined index on a table? Or is multiple single column indexes better? If I have table 'foo' with columns a, b, and c. I will have a query like: select c from foo where a in (1,2,3) and b 12345; Is index on a,b better

Re: combined or single indexes?

2010-07-08 Thread Neil Tompkins
the index, without getting data from the table. -- Octavian - Original Message - From: Bryan Cantwell bcantw...@firescope.com To: mysql@lists.mysql.com Sent: Tuesday, July 06, 2010 6:41 PM Subject: combined or single indexes? Is there a benefit to a combined index on a table

Re: combined or single indexes?

2010-07-08 Thread Johan De Meersman
On Fri, Jul 9, 2010 at 7:30 AM, Neil Tompkins neil.tompk...@googlemail.comwrote: Should we be looking to create a index for all fields that we might be perform a select condition in a where clause for ? It's a bit of trial and error, you have to weight the number of times you select based on

combined or single indexes?

2010-07-06 Thread Bryan Cantwell
Is there a benefit to a combined index on a table? Or is multiple single column indexes better? If I have table 'foo' with columns a, b, and c. I will have a query like: select c from foo where a in (1,2,3) and b 12345; Is index on a,b better in any way than an a index and a b index? An explain

Re: combined or single indexes?

2010-07-06 Thread Joerg Bruehe
Hi Bryan, all! Bryan Cantwell wrote: Is there a benefit to a combined index on a table? Or is multiple single column indexes better? This is a FAQ, but I'm not aware of a place to point you for the answer. If I have table 'foo' with columns a, b, and c. I will have a query like: select

Re: combined or single indexes?

2010-07-06 Thread Octavian Rasnita
only the index, without getting data from the table. -- Octavian - Original Message - From: Bryan Cantwell bcantw...@firescope.com To: mysql@lists.mysql.com Sent: Tuesday, July 06, 2010 6:41 PM Subject: combined or single indexes? Is there a benefit to a combined index on a table