MySQL Forums
Forum List  »  Partitioning

RE:how to make partititon for my table as required
Posted by: venkat puvvada
Date: April 13, 2011 01:11AM

dear all,
i done like this..
step1:
create table pvk_table_test_solve1 as SELECT * from pvk_table_test;

step2:
ALTER table pvk_table_test_solve1 add PRIMARY KEY(asset_id, reading_datetime, meter_id);

step3:
ALTER TABLE pvk_table_test_solve1 PARTITION BY HASH(month(reading_date) )
PARTITIONS 12;
error:
[SQL] ALTER TABLE pvk_table_test_solve1 PARTITION BY HASH(month(reading_date) )
PARTITIONS 12;
[Err] 1503 - A PRIMARY KEY must include all columns in the table's partitioning function


my requirement :
SELECT reading_date ,..... FROM pvk_table_test_slove1 eu
WHERE reading_date >='2009-10-02' AND reading_date <= '2010-10-02' AND assetid ='99' GROUP BY reading_date,eu.tou;

note:
because of not using partition filed in my query we are not getting good result.
now,what i need to do for this case?


please help me on the same....

regards,
venkat p



Edited 3 time(s). Last edit at 04/13/2011 01:21AM by venkat puvvada.

Options: ReplyQuote


Subject
Views
Written By
Posted
RE:how to make partititon for my table as required
3782
April 13, 2011 01:11AM


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.