postgresql和oracle的UUID char(32)
Postgresql 8.3获取uuid方法需先导入uuid-ossp.sql文件 C:PostgreSQL8.3bin>psql -ddbname -Uuname -f C:PostgreSQL8.3sharecontribuuid-ossp.sql select regexp_replace(''||uuid_generate_v4(),'-','','g'); select regexp_replace(''||uuid_generate_v4(),'g') as pk_new,pk_id from table; 查询两千条数据4000毫秒,效率低;
当前时间+行号 create sequence seq_rownum; select setval('seq_rownum',1); select to_char(now(),'yyyymmddhh24miss')||lpad(''||(nextval('seq_rownum')-1),18,'0')as pk_new,pk_id from table; 查询两千条数据80毫秒
Oracle自带函数 select sys_guid() from dual; select sys_guid() as pk_new,pk_id from table; 查询两千条数据30毫秒 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |