CN103729447A - 一种数据库快速检索的方法 - Google Patents
一种数据库快速检索的方法 Download PDFInfo
- Publication number
- CN103729447A CN103729447A CN201310746424.8A CN201310746424A CN103729447A CN 103729447 A CN103729447 A CN 103729447A CN 201310746424 A CN201310746424 A CN 201310746424A CN 103729447 A CN103729447 A CN 103729447A
- Authority
- CN
- China
- Prior art keywords
- data
- query
- memchace
- temp
- temporary table
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
- G06F16/2272—Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2477—Temporal data queries
Abstract
本发明涉及软件技术领域,具体涉及一种数据库快速检索的方法。本发明通过部署一套业务数据临时表对业务数据进行缓存与分层检查,并结合memchace缓存,把查询结果缓存至memechace中;当再次查询时,只需要通过key值在memchace中取即可。因为memchace是内存对象疑缓存系统,查询速度更快,因为比对数据库操作效率更高;同时结合定时器,对memchace进行清洁,这样可以使查询得至最全的数据结果体;本发明的方法可以广泛应用于软件产品的数据库查询业务。
Description
技术领域
本发明涉及软件技术领域,具体涉及一种数据库快速检索的方法。
背景技术
目前的业务系统越来越负责,但在软件设计的过程中,大家都是使用面向对象的方法设计与开发平台,如一个学籍管理系统中的学生信息可能包括教师信息、教室信息、成绩信息、考勤信息、班级信息、联系人信息。同时这些信息都通过独立的表存放,学生信息只会保存上述信息的关联信息,但需要获取上述信息时可通过关联查询获取。该设计方法是符合软件设计的,而且可以让软件更灵活,但在数据查询的过程中就会出现问题;因为上述信息都是存放在不同的表中,因此需要通过表关联的方法关联所有信息。而关联会造成结果数据量快速增加,如学生信息有50条记录,教室信息有12条信息,当关联该两张表时的笛卡尔积就会出现600条记录,关联的表越多,笛卡尔积增加的越快。因此在一些高频的查询业务中,该方法可能无法满足系统的并发要求,或者响应效率很低。
发明内容
本发明解决的技术问题在于提供一种数据库快速检索的方法。
本发明解决上述技术问题的技术方案是:
通过定时器,定时的将业务数据存放在一张临时表中,同时根据业务需要建立相应的索引;在数据查询时,先通过memchace缓存中取数据,如果数据为空,再查询temp数据表,并返回给用户;同时将结果集缓存至memchace中;在用户再通过该关键字查询时,可以直接通过关键字在memchace中获取相应的结果集。
2、根据权利要求1所述的数据库快速检索的方法,其特征在于:
主要包括如下步骤:
第1步、根据业务需要,创建某一业务的临时表temp;
第2步、并根据业务需要,为表建立相应的索引;
第3步、通过定期器,对某一业务的查询数据关联表,插入该临时表temp中;在播入临时表时,首先删除旧的数据;
第4步、在该业务系统查询中,首先通过关键字,在memchace查询是否存在结果值,如果存在,则直接返回结果集;如果不存在,则执行第5步;
第5步、查询temp临时表,并将关键字作为key,将结合集成为value,放入至menchace缓存中,同时将结果集返回客户端。
本发明的有益效果是:本发明首先了解系统中高频发生的查询业务,并明确返回结果集的数据来源表。然后建立一张临时表,该临时表中包含所有返回的信息列。并在一些关键字上建立相索引,在该业务的查询功能中,使用该表代替之前的关联表即可,同时组合索引,可以更快的查询出用户需要的信息。因此,本发明方法可以大大提高业务系统复杂的查询功能,提高系统的并发响应速度。而且该方法只需要在软件层做相应的优化,不会增加平台的费用。
附图说明
下面结合附图对本发明进一步说明:
图1为本发明方法流程图;
图2为本发明学籍管理系统的学生信息数据库结构图。
具体实施方式
如图所示,本发明主要包括如下步骤:
第1步、根据业务需要,创建某一业务的临时表temp;
第2步、并根据业务需要,为表建立相应的索引;
第3步、通过定期器,对某一业务的查询数据关联表,插入该临时表temp中;在播入临时表时,首先删除旧的数据;
第4步、在该业务系统查询中,首先通过关键字,在memchace查询是否存在结果值,如果存在,则直接返回结果集;如果不存在,则执行第5步;
第5步、查询temp临时表,并将关键字作为key,将结合集成为value,放入至menchace缓存中,同时将结果集返回客户端。
如图2所示,下面具体以学籍管理平台为例,讲述该方法的优点。
在学籍管理系统中,主要包括学生信息(student)、班级信息(class)、教室信息(class_room)、年级信息(grant)、教师信息(teacher)
其中学生信息包括与班级信息表的关联信息class_id;
学生信息含与教室信息的关联信息class_room_id;
学生信息含与年级信息的关联信息grant_id;
学生信息含与教师信息的关联信息teacher_id。
学籍管理系统存在一个高频发生的查询业务,主要查询学生的详细信息,包括显示学生的姓名与学号、班主任的姓名、班级、教室信息时,只可以通过以下的关联查询:
该查询方法不断代码较为复杂,而且因为关联多张表,效果也比较低。
根据本发明的方法,可以更好的实现查询效果:
第1步、建立一张临时表temp,包括以下字段student_name,class_name,teacher_name,class_room_name,grant_name;
第2步、通过定时器,从sutdent t1,class t2,teacher t3,class_roomt4,grant t5中获取详细信息:
第3步、在业务系统查询功能中,即可通过以下语句查询:Select*from temp。
Claims (2)
1.一种数据库快速检索的方法,其特征在于:通过定时器,定时的将业务数据存放在一张临时表中,同时根据业务需要建立相应的索引;在数据查询时,先通过memchace缓存中取数据,如果数据为空,再查询temp数据表,并返回给用户;同时将结果集缓存至memchace中;在用户再通过该关键字查询时,可以直接通过关键字在memchace中获取相应的结果集。
2.根据权利要求1所述的数据库快速检索的方法,其特征在于:
主要包括如下步骤:
第1步、根据业务需要,创建某一业务的临时表temp;
第2步、并根据业务需要,为表建立相应的索引;
第3步、通过定期器,对某一业务的查询数据关联表,插入该临时表temp中;在播入临时表时,首先删除旧的数据;
第4步、在该业务系统查询中,首先通过关键字,在memchace查询是否存在结果值,如果存在,则直接返回结果集;如果不存在,则执行第5步;
第5步、查询temp临时表,并将关键字作为key,将结合集成为value,放入至menchace缓存中,同时将结果集返回客户端。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310746424.8A CN103729447A (zh) | 2013-12-29 | 2013-12-29 | 一种数据库快速检索的方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310746424.8A CN103729447A (zh) | 2013-12-29 | 2013-12-29 | 一种数据库快速检索的方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103729447A true CN103729447A (zh) | 2014-04-16 |
Family
ID=50453521
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310746424.8A Pending CN103729447A (zh) | 2013-12-29 | 2013-12-29 | 一种数据库快速检索的方法 |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103729447A (zh) |
Cited By (35)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104391864A (zh) * | 2014-10-24 | 2015-03-04 | 浪潮软件股份有限公司 | 一种便于一次性获取信息的非结构化数据存储方法 |
WO2015196413A1 (en) * | 2014-06-26 | 2015-12-30 | Intel Corporation | Memcached systems having local caches |
CN106202080A (zh) * | 2015-04-30 | 2016-12-07 | 中国移动通信集团公司 | 一种网页渲染方法、服务器及终端设备 |
WO2020220216A1 (en) * | 2019-04-29 | 2020-11-05 | Splunk Inc. | Search time estimate in data intake and query system |
US11232100B2 (en) | 2016-09-26 | 2022-01-25 | Splunk Inc. | Resource allocation for multiple datasets |
US11238112B2 (en) | 2016-09-26 | 2022-02-01 | Splunk Inc. | Search service system monitoring |
US11250056B1 (en) | 2016-09-26 | 2022-02-15 | Splunk Inc. | Updating a location marker of an ingestion buffer based on storing buckets in a shared storage system |
US11281706B2 (en) | 2016-09-26 | 2022-03-22 | Splunk Inc. | Multi-layer partition allocation for query execution |
US11294941B1 (en) | 2016-09-26 | 2022-04-05 | Splunk Inc. | Message-based data ingestion to a data intake and query system |
US11321321B2 (en) | 2016-09-26 | 2022-05-03 | Splunk Inc. | Record expansion and reduction based on a processing task in a data intake and query system |
US11341131B2 (en) | 2016-09-26 | 2022-05-24 | Splunk Inc. | Query scheduling based on a query-resource allocation and resource availability |
US11416528B2 (en) | 2016-09-26 | 2022-08-16 | Splunk Inc. | Query acceleration data store |
US11442935B2 (en) | 2016-09-26 | 2022-09-13 | Splunk Inc. | Determining a record generation estimate of a processing task |
US11461334B2 (en) | 2016-09-26 | 2022-10-04 | Splunk Inc. | Data conditioning for dataset destination |
US11494380B2 (en) | 2019-10-18 | 2022-11-08 | Splunk Inc. | Management of distributed computing framework components in a data fabric service system |
US11500875B2 (en) | 2017-09-25 | 2022-11-15 | Splunk Inc. | Multi-partitioning for combination operations |
US11550847B1 (en) | 2016-09-26 | 2023-01-10 | Splunk Inc. | Hashing bucket identifiers to identify search nodes for efficient query execution |
US11562023B1 (en) | 2016-09-26 | 2023-01-24 | Splunk Inc. | Merging buckets in a data intake and query system |
US11567993B1 (en) | 2016-09-26 | 2023-01-31 | Splunk Inc. | Copying buckets from a remote shared storage system to memory associated with a search node for query execution |
US11580107B2 (en) | 2016-09-26 | 2023-02-14 | Splunk Inc. | Bucket data distribution for exporting data to worker nodes |
US11586692B2 (en) | 2016-09-26 | 2023-02-21 | Splunk Inc. | Streaming data processing |
US11586627B2 (en) | 2016-09-26 | 2023-02-21 | Splunk Inc. | Partitioning and reducing records at ingest of a worker node |
US11593377B2 (en) | 2016-09-26 | 2023-02-28 | Splunk Inc. | Assigning processing tasks in a data intake and query system |
US11599541B2 (en) | 2016-09-26 | 2023-03-07 | Splunk Inc. | Determining records generated by a processing task of a query |
US11604795B2 (en) | 2016-09-26 | 2023-03-14 | Splunk Inc. | Distributing partial results from an external data system between worker nodes |
US11615104B2 (en) | 2016-09-26 | 2023-03-28 | Splunk Inc. | Subquery generation based on a data ingest estimate of an external data system |
US11620336B1 (en) | 2016-09-26 | 2023-04-04 | Splunk Inc. | Managing and storing buckets to a remote shared storage system based on a collective bucket size |
US11663227B2 (en) | 2016-09-26 | 2023-05-30 | Splunk Inc. | Generating a subquery for a distinct data intake and query system |
US11704313B1 (en) | 2020-10-19 | 2023-07-18 | Splunk Inc. | Parallel branch operation using intermediary nodes |
US11715051B1 (en) | 2019-04-30 | 2023-08-01 | Splunk Inc. | Service provider instance recommendations using machine-learned classifications and reconciliation |
US11720537B2 (en) | 2018-04-30 | 2023-08-08 | Splunk Inc. | Bucket merging for a data intake and query system using size thresholds |
US11860940B1 (en) | 2016-09-26 | 2024-01-02 | Splunk Inc. | Identifying buckets for query execution using a catalog of buckets |
US11874691B1 (en) | 2016-09-26 | 2024-01-16 | Splunk Inc. | Managing efficient query execution including mapping of buckets to search nodes |
US11922222B1 (en) | 2020-01-30 | 2024-03-05 | Splunk Inc. | Generating a modified component for a data intake and query system using an isolated execution environment image |
US11921672B2 (en) | 2017-07-31 | 2024-03-05 | Splunk Inc. | Query execution at a remote heterogeneous data store of a data fabric service |
-
2013
- 2013-12-29 CN CN201310746424.8A patent/CN103729447A/zh active Pending
Cited By (43)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015196413A1 (en) * | 2014-06-26 | 2015-12-30 | Intel Corporation | Memcached systems having local caches |
CN106537375A (zh) * | 2014-06-26 | 2017-03-22 | 英特尔公司 | 具有本地高速缓存的内存缓存系统 |
US10277707B2 (en) | 2014-06-26 | 2019-04-30 | Intel Corporation | Memcached systems having local caches |
CN106537375B (zh) * | 2014-06-26 | 2020-02-14 | 英特尔公司 | 具有本地高速缓存的内存缓存系统 |
CN104391864A (zh) * | 2014-10-24 | 2015-03-04 | 浪潮软件股份有限公司 | 一种便于一次性获取信息的非结构化数据存储方法 |
CN106202080A (zh) * | 2015-04-30 | 2016-12-07 | 中国移动通信集团公司 | 一种网页渲染方法、服务器及终端设备 |
US11550847B1 (en) | 2016-09-26 | 2023-01-10 | Splunk Inc. | Hashing bucket identifiers to identify search nodes for efficient query execution |
US11586627B2 (en) | 2016-09-26 | 2023-02-21 | Splunk Inc. | Partitioning and reducing records at ingest of a worker node |
US11238112B2 (en) | 2016-09-26 | 2022-02-01 | Splunk Inc. | Search service system monitoring |
US11250056B1 (en) | 2016-09-26 | 2022-02-15 | Splunk Inc. | Updating a location marker of an ingestion buffer based on storing buckets in a shared storage system |
US11281706B2 (en) | 2016-09-26 | 2022-03-22 | Splunk Inc. | Multi-layer partition allocation for query execution |
US11294941B1 (en) | 2016-09-26 | 2022-04-05 | Splunk Inc. | Message-based data ingestion to a data intake and query system |
US11321321B2 (en) | 2016-09-26 | 2022-05-03 | Splunk Inc. | Record expansion and reduction based on a processing task in a data intake and query system |
US11341131B2 (en) | 2016-09-26 | 2022-05-24 | Splunk Inc. | Query scheduling based on a query-resource allocation and resource availability |
US11392654B2 (en) | 2016-09-26 | 2022-07-19 | Splunk Inc. | Data fabric service system |
US11416528B2 (en) | 2016-09-26 | 2022-08-16 | Splunk Inc. | Query acceleration data store |
US11442935B2 (en) | 2016-09-26 | 2022-09-13 | Splunk Inc. | Determining a record generation estimate of a processing task |
US11461334B2 (en) | 2016-09-26 | 2022-10-04 | Splunk Inc. | Data conditioning for dataset destination |
US11966391B2 (en) | 2016-09-26 | 2024-04-23 | Splunk Inc. | Using worker nodes to process results of a subquery |
US11874691B1 (en) | 2016-09-26 | 2024-01-16 | Splunk Inc. | Managing efficient query execution including mapping of buckets to search nodes |
US11860940B1 (en) | 2016-09-26 | 2024-01-02 | Splunk Inc. | Identifying buckets for query execution using a catalog of buckets |
US11562023B1 (en) | 2016-09-26 | 2023-01-24 | Splunk Inc. | Merging buckets in a data intake and query system |
US11567993B1 (en) | 2016-09-26 | 2023-01-31 | Splunk Inc. | Copying buckets from a remote shared storage system to memory associated with a search node for query execution |
US11580107B2 (en) | 2016-09-26 | 2023-02-14 | Splunk Inc. | Bucket data distribution for exporting data to worker nodes |
US11586692B2 (en) | 2016-09-26 | 2023-02-21 | Splunk Inc. | Streaming data processing |
US11232100B2 (en) | 2016-09-26 | 2022-01-25 | Splunk Inc. | Resource allocation for multiple datasets |
US11593377B2 (en) | 2016-09-26 | 2023-02-28 | Splunk Inc. | Assigning processing tasks in a data intake and query system |
US11599541B2 (en) | 2016-09-26 | 2023-03-07 | Splunk Inc. | Determining records generated by a processing task of a query |
US11604795B2 (en) | 2016-09-26 | 2023-03-14 | Splunk Inc. | Distributing partial results from an external data system between worker nodes |
US11615104B2 (en) | 2016-09-26 | 2023-03-28 | Splunk Inc. | Subquery generation based on a data ingest estimate of an external data system |
US11797618B2 (en) | 2016-09-26 | 2023-10-24 | Splunk Inc. | Data fabric service system deployment |
US11620336B1 (en) | 2016-09-26 | 2023-04-04 | Splunk Inc. | Managing and storing buckets to a remote shared storage system based on a collective bucket size |
US11663227B2 (en) | 2016-09-26 | 2023-05-30 | Splunk Inc. | Generating a subquery for a distinct data intake and query system |
US11921672B2 (en) | 2017-07-31 | 2024-03-05 | Splunk Inc. | Query execution at a remote heterogeneous data store of a data fabric service |
US11860874B2 (en) | 2017-09-25 | 2024-01-02 | Splunk Inc. | Multi-partitioning data for combination operations |
US11500875B2 (en) | 2017-09-25 | 2022-11-15 | Splunk Inc. | Multi-partitioning for combination operations |
US11720537B2 (en) | 2018-04-30 | 2023-08-08 | Splunk Inc. | Bucket merging for a data intake and query system using size thresholds |
US11615087B2 (en) | 2019-04-29 | 2023-03-28 | Splunk Inc. | Search time estimate in a data intake and query system |
WO2020220216A1 (en) * | 2019-04-29 | 2020-11-05 | Splunk Inc. | Search time estimate in data intake and query system |
US11715051B1 (en) | 2019-04-30 | 2023-08-01 | Splunk Inc. | Service provider instance recommendations using machine-learned classifications and reconciliation |
US11494380B2 (en) | 2019-10-18 | 2022-11-08 | Splunk Inc. | Management of distributed computing framework components in a data fabric service system |
US11922222B1 (en) | 2020-01-30 | 2024-03-05 | Splunk Inc. | Generating a modified component for a data intake and query system using an isolated execution environment image |
US11704313B1 (en) | 2020-10-19 | 2023-07-18 | Splunk Inc. | Parallel branch operation using intermediary nodes |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103729447A (zh) | 一种数据库快速检索的方法 | |
CN106227800B (zh) | 一种高度关联大数据的存储方法及管理系统 | |
CN104750681B (zh) | 一种海量数据的处理方法及装置 | |
CN105868411B (zh) | 一种非关系型与关系型数据库一体化数据查询方法与系统 | |
US9047333B2 (en) | Dynamic updates to a semantic database using fine-grain locking | |
US9715536B2 (en) | Virtualization method for large-scale distributed heterogeneous data | |
CN105930446B (zh) | 一种基于Hadoop分布式技术的电信客户标签生成方法 | |
CN103390015B (zh) | 基于统一索引的海量数据联合存储方法及检索方法 | |
CN107423422A (zh) | 基于网格的空间数据分布式存储及检索方法和系统 | |
CN100594497C (zh) | 一种实现网络查询缓存的系统和查询方法 | |
WO2006107772A3 (en) | System and methods for facilitating a linear grid database with data organization by dimension | |
CN104850572A (zh) | HBase非主键索引构建与查询方法及其系统 | |
CN108664516A (zh) | 查询优化方法及相关装置 | |
CN106407303A (zh) | 数据存储、查询方法及装置 | |
CN103646032A (zh) | 一种基于本体和受限自然语言处理的数据库查询方法 | |
CN102999563A (zh) | 基于资源描述框架的网络资源语义检索方法及系统 | |
CN106708996A (zh) | 用于对关系数据库进行全文搜索的方法及系统 | |
CN103838770A (zh) | 一种数据逻辑分区的方法和系统 | |
CN104391908B (zh) | 一种图上基于局部敏感哈希的多关键字索引方法 | |
CN103823846A (zh) | 一种基于图论的大数据存储及查询方法 | |
CN104834700A (zh) | 一种基于轨迹变更的移动数据增量捕获方法 | |
CN108509437A (zh) | 一种ElasticSearch查询加速方法 | |
CN105159616A (zh) | 一种磁盘空间管理方法及装置 | |
Xiong et al. | Data vitalization: a new paradigm for large-scale dataset analysis | |
CN103036921B (zh) | 一种用户行为分析系统和方法 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140416 |
|
RJ01 | Rejection of invention patent application after publication |