CREATE PROCEDURE SAVE_SPHINX_TABLE_INDEXED(IN MAX_ID_INDEXED BIGINT, IN TB_NAME VARCHAR(200), IN INDEX_NAME VARCHAR(200))
BEGIN
IF MAX_ID_INDEXED > 0
THEN
REPLACE INTO sphinx_table_indexed(tb_name, index_name, index_time, index_max_id) values(TB_NAME, INDEX_NAME, NOW(), MAX_ID_INDEXED);
END IF;
END