Performance verifying for Sqlite in-memory mode.
Testing environment:
test case bytes * times Insert Query once a record and ( 50 * 100 )bytes every record
times Insert
Query
100K bytes = bytes * times
10bytes * 10K 1.154s 1.825s 1K
0.187s 6.240s 100bytes * 1K 0.109s 0.219s 100 0.015s 0.656s 1K * 100 0.000s 0.016s 10 0.000s 0.063s 10K * 10
select * from role_sys_privs;
2、查看所有用户:
select * from all_users;
3、查看当前用户的详细信息:
select * from user_users;
4、查看所有角色:
select * from dba_roles;
5、查看当前用户的角色信息:
select * from user_role_privs;
6,,查询数据库上操作的所有命令,,需要有dba权限
select * from v$sqlarea t order by t.FIRST_LOAD_TIME desc
SQL SERVER 根据地图经纬度计算距离的公式
go
--创建经纬度距离计算函数
CREATEFUNCTION [dbo].[fnGetDistance]
--LatBegin 开始经度
--LngBegin 开始维度
(@LatBegin REAL, @LngBegin REAL, @LatEnd REAL, @LngEnd REAL)
RETURNSFLOAT
AS
BEGIN
--距离(千米)
DECLARE @Distance REAL
DECLARE @EARTH_RADIUS REAL
SET @EARTH_RADIUS = 6378.137
DECLARE @RadLatBegin REAL,
@RadLatEnd REAL,
@RadLatDiff REAL,
@RadLngDiff REAL
SET @RadLatBegin = @LatBegin *PI()/ 180.0
SET @RadLatEnd = @LatEnd *PI()/ 180.0
SET @RadLatDiff = @RadLatBegin - @RadLatEnd
SET @RadLngDiff = @LngBegin *PI()/ 180.0 - @LngEnd *PI()/ 180.0
SET @Distance = 2 *ASIN(
SQRT(
POWER(SIN(@RadLatDiff / 2), 2)+COS(@RadLatBegin)*COS(@RadLatEnd)
*POWER(SIN(@RadLngDiff / 2), 2)
)
)
SET @Distance = @Distance * @EARTH_RADIUS
--SET @Distance = Round(@Distance * 10000) / 10000
RETURN @Distance
END
@Distance的单位为:千米