数据库有效检索 [英] Database Efficient Retrival

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

问题描述

我的数据库中有2个表,分别是table-1和table-2.每次都需要从两个表中搜索记录以进行恢复.

为此,需要花费更多时间搜索所有记录.相反,我认为我应该制作一个备份表并对其进行操作.当我的搜索为真后,我删除该条目.这将每次减小表的大小.这是正确的方法还是简单的搜索将不会花费很长时间.

我有70到8万条条目.

I am having 2 tables in my database say table-1 and table-2. It needs searching of records every time from two tables for retreival.

For this does it takees more time searching all records. Instead i am thinking that i should make a backup table and operate on it.After my search is true i delete that entry. This will reduce table size every time. Is this a proper way or simple search will not take a long time .

I am having arround 70-80 thousand entries.

推荐答案

加快查询速度的正确方法是使用索引.看看数据库索引 [ ^ ]和 SQL CREATE INDEX语句 [ ^ ].

对于MySql,请参考 MySQL如何使用索引 [创建索引语法 [
The proper way to speed up queries is to use indexing. Have a look at Database index[^] and SQL CREATE INDEX Statement[^].

For MySql refer to How MySQL Uses Indexes[^] and CREATE INDEX Syntax[^]


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

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