List:General Discussion« Previous MessageNext Message »
From:Charles Lambach Date:April 27 2008 10:59am
Subject:Optimizing table (shall I create a primary field?)
View as plain text  
Hi.

My hosting provider recommended me to optimize my 200,000 record table in
order to save resources.

I do _always_ this query:
SELECT * FROM books WHERE isbn='foo' LIMIT 1

The primary key of this table was 'id', and 'isbn' was and INDEX field.

I've modified this:
ALTER TABLE books DROP PRIMARY KEY, ADD INDEX ('isbn')
ALTER TABLE books ADD PRIMARY KEY ('isbn')

Is this a good change? Am I going to waste less resources with 'isbn' field
as primary key?

Thank you very much.

Thread
Optimizing table (shall I create a primary field?)Charles Lambach27 Apr
  • Re: Optimizing table (shall I create a primary field?)Rob Wultsch27 Apr
    • Re: Optimizing table (shall I create a primary field?)Charles Lambach28 Apr
      • Re: Optimizing table (shall I create a primary field?)Rob Wultsch28 Apr
        • Re: Optimizing table (shall I create a primary field?)Rob Wultsch28 Apr
          • Re: Optimizing table (shall I create a primary field?)Wm Mussatto28 Apr
            • Re: Optimizing table (shall I create a primary field?)Charles Lambach29 Apr
              • Re: Optimizing table (shall I create a primary field?)Rob Wultsch29 Apr
  • Re: Optimizing table (shall I create a primary field?)Sebastian Mendel30 Apr