MySQL Forums
Forum List  »  Partitioning

Re: Partitioning throwing #1064 - Constant/Random expression in (sub)partitioning function is not allowed near ') ( PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2) PARTIT' at line 2 error
Posted by: Rick James
Date: April 17, 2009 09:44PM

Ouch, ouch and OUCH!

* Add an index!

* Maybe add another index.

* Avoid LIKE '%xxx%'; consider FULLTEXT index.

* CONCAT(UPPER(SUBSTRING(city, 1, 1)), LOWER(SUBSTRING(city FROM 2)))
will produce
Los angeles ?

* bigint -- only needed if you might get billions. Suggest INT, MEDIUMINT, etc.

Adding indexes will help more than partitioning!

Do this:
ALTER TABLE tbl_businesses
   ADD INDEX (city_id, state_code);
And see how that select performs.

Then show us some of your other queries.

Back to "Los angeles" -- Recommend you put the correct spelling into the table.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partitioning throwing #1064 - Constant/Random expression in (sub)partitioning function is not allowed near ') ( PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2) PARTIT' at line 2 error
2915
April 17, 2009 09:44PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.