Hi
I’m using pt-archiver Ver 2.2.12 and mysql Ver 14.14 Distrib 5.6.21-70.1.
I have a table where one of the key components (user_id) is of type varchar(100); the table has the following keys:
PRIMARY KEY (id
,start
,end
,user_id
(13),interval
),
KEY uid_start_end
(user_id
(13),start
,end
)
The select query generated by pt-archiver is as follows:
SELECT /*!40001 SQL_NO_CACHE */ id
,end
,start
, …
FROM dbX
.tableY
FORCE INDEX(PRIMARY
)
WHERE (id = 12345)
ORDER BY id
,start
,end
,user_id
(13),interval
LIMIT 1000;
I’m running pt-archiver via a bash script …
pt-archiver --source “D=${SHARD_OLD},p=XXXXXX,t=$table” --dest “D=${SHARD_NEW},p=XXXXXX,t=$table” --where “some_id = ${SOME_ID}” --limit 1000 --no-ascend --no-delete --replace --low-priority-insert --statistics --progress 1000
I get the following exception
DBD::mysql::st execute failed: FUNCTION dbX.user_id does not exist [for Statement "
SELECT /*!40001 SQL_NO_CACHE */ …
FROM dbX
.tableY
FORCE INDEX(PRIMARY
)
WHERE (id = 12345) ORDER BY id
,start
,end
,user_id
(13),interval
LIMIT 1000
"] at /usr/bin/pt-archiver line 5991.
I’m not liberty to change the primary key (I know the select query works when I replace “user_id(13)” with “user_id”).
Is there a way I can resolve this without creating (then dropping) an alternative index?
Regards