优化数据库搜索. [英] Optimizing database search.

查看:76
本文介绍了优化数据库搜索.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表:
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?

推荐答案

读给我的朋友.
http://en.wikipedia.org/wiki/Pagination [ http://en.wikipedia.org/wiki/Common_table_expression [
Read this my friend.
http://en.wikipedia.org/wiki/Pagination[^]

http://en.wikipedia.org/wiki/Common_table_expression[^]

Just a general idea :)

Regards,
Eduard


使用两个表之间的主键-外键关系作为绑定器.那些总是被索引.
Use the primary-foreign key relationship between the two tables as the binder. Those are always indexed.


这篇关于优化数据库搜索.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆