用一个adoquery进行了大量数据查询,大概用了10多个 lookup 字段,导致查询速度,以及服务器内存消耗较大有什么方法,可以改进???具体如下:
一个病人信息表 Pat_patient 大约10万条数据sql语句:select top 1000 * from Pat_Patient where CheckNoId = 6757 order by checkid asc,recheckman asc不用lookup字段,查询数据很快,<1秒但是用了大量lookup字段后,速度和内存都消耗很大,时间>15秒
一个病人信息表 Pat_patient 大约10万条数据sql语句:select top 1000 * from Pat_Patient where CheckNoId = 6757 order by checkid asc,recheckman asc不用lookup字段,查询数据很快,<1秒但是用了大量lookup字段后,速度和内存都消耗很大,时间>15秒
会降低效率的
shid int 主键
shname varchar 这样的码表比较多
id int
name varchar
它的记录为3条,分别为
1 aaa
2 bbb
3 ccc现在如何一个sql语句,查询主表关联码表把id1 id2 id3关联cod_sh的name字段查询出来:
select .... from pat_patient inner join cod_sh on cod_sh.id=pat_patient.id1......???
要求结果为:
aaa bbb ccc