问题描述
我有两个表:
1. D_EMPLOYEE
-主键(员工ID)
2. D_EMPLOYEE_DETAIL
-外键(员工ID)D_EMPLYEE
包含员工名称,D_EMPLOYEE_DETAIL
包含特定员工的详细信息.
我想通过提供特定雇员的姓名来对其进行搜索,并检索存储在D_EMPLOYEE_DETAIL
表中的雇员代码.
这是一个简单的查询,但是问题在于数据库的大小非常大,并且name列没有索引,因此比通常需要更长的时间.
请帮我在几秒钟内从如此庞大的数据库中搜索的任何替代方法吗?
I have two tables :
1. D_EMPLOYEE
-- Primary key (Employee ID)
2. D_EMPLOYEE_DETAIL
-- Foreign key (Employee ID)D_EMPLYEE
contains the employee name and D_EMPLOYEE_DETAIL
contains the details of a perticular employee.
I want to perform a search for a perticular employee by providing his name and retrive the employee code that is stored in D_EMPLOYEE_DETAIL
table.
This is a simple query but the problem is that the database size is extremely huge and name column has no index due to which it takes larger time than usual.
Please help me any alternative to search from such a huge database in fraction of sec?
推荐答案
这篇关于优化数据库搜索.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!