BaoLiang
3 years ago
committed by
GitHub
5 changed files with 63 additions and 3 deletions
@ -0,0 +1,21 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
|
||||
SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); |
||||
|
||||
alter table t_ds_process_instance drop KEY `start_time_index`; |
||||
alter table t_ds_process_instance add KEY `start_time_index` (`start_time`,`end_time`) USING BTREE; |
@ -0,0 +1,40 @@
|
||||
/* |
||||
* Licensed to the Apache Software Foundation (ASF) under one or more |
||||
* contributor license agreements. See the NOTICE file distributed with |
||||
* this work for additional information regarding copyright ownership. |
||||
* The ASF licenses this file to You under the Apache License, Version 2.0 |
||||
* (the "License"); you may not use this file except in compliance with |
||||
* the License. You may obtain a copy of the License at |
||||
* |
||||
* http://www.apache.org/licenses/LICENSE-2.0 |
||||
* |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
delimiter d// |
||||
CREATE OR REPLACE FUNCTION public.dolphin_update_metadata( |
||||
) |
||||
RETURNS character varying |
||||
LANGUAGE 'plpgsql' |
||||
COST 100 |
||||
VOLATILE PARALLEL UNSAFE |
||||
AS $BODY$ |
||||
DECLARE |
||||
v_schema varchar; |
||||
BEGIN |
||||
---get schema name |
||||
v_schema =current_schema(); |
||||
|
||||
EXECUTE 'DROP INDEX IF EXISTS "start_time_index"'; |
||||
EXECUTE 'CREATE INDEX IF NOT EXISTS start_time_index ON ' || quote_ident(v_schema) ||'.t_ds_process_instance USING Btree("start_time","end_time")'; |
||||
|
||||
return 'Success!'; |
||||
exception when others then |
||||
---Raise EXCEPTION '(%)',SQLERRM; |
||||
return SQLERRM; |
||||
END; |
||||
$BODY$; |
||||
d// |
Loading…
Reference in new issue