WO2020108345A1 - 数据库索引以及数据库查询的处理方法、装置及设备 - Google Patents

数据库索引以及数据库查询的处理方法、装置及设备 Download PDF

Info

Publication number
WO2020108345A1
WO2020108345A1 PCT/CN2019/119394 CN2019119394W WO2020108345A1 WO 2020108345 A1 WO2020108345 A1 WO 2020108345A1 CN 2019119394 W CN2019119394 W CN 2019119394W WO 2020108345 A1 WO2020108345 A1 WO 2020108345A1
Authority
WO
WIPO (PCT)
Prior art keywords
spatial
index
query
database table
field
Prior art date
Application number
PCT/CN2019/119394
Other languages
English (en)
French (fr)
Inventor
胡炜
周杰
何登成
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to EP19889311.7A priority Critical patent/EP3889797A4/en
Priority to JP2021529833A priority patent/JP2022510184A/ja
Publication of WO2020108345A1 publication Critical patent/WO2020108345A1/zh
Priority to US17/332,724 priority patent/US20210286795A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9537Spatial or temporal dependent retrieval, e.g. spatiotemporal queries
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of data processing, and in particular to a database index processing method, device, electronic device, and storage device. This application also relates to a database query processing method, device, electronic equipment, and storage equipment.
  • spatial data and databases supporting storage and management of spatial data have been widely used in various industries, for example, for urban planning, transportation, banking, aerospace, etc.
  • the so-called spatial data also known as geometric data
  • geometric data is a special type of data that can be processed by computers to represent information containing spatial coordinates, for example, spatial data representing architectural design drawings, mechanical design drawings, and maps.
  • Spatial data can quantitatively describe things and phenomena that have positioning significance in the real world, such as identifying the location, shape, size, and distribution characteristics of spatial entities.
  • the so-called spatial entity is the result of abstracting geographic things and phenomena, and is also called geographic entity or entity.
  • the so-called spatial index is a data structure arranged in a certain order according to the position and shape of the spatial object or some spatial relationship between the spatial objects.
  • the existing spatial index only stores MBR (Minimum bounding rectangle) information that can cover spatial objects.
  • MBR Minimum bounding rectangle
  • MBR refers to the smallest enclosing matrix that can cover spatial objects in two dimensions.
  • This application provides a method for processing database indexes and a method for processing database queries to improve the query efficiency of spatial data.
  • This application provides a method for processing database indexes, including:
  • the database table contains a spatial field for storing spatial data
  • a tree structure spatial index of the database table is generated; wherein, the leaf nodes of the tree structure spatial index store spatial data and primary key identifiers that meet the spatial filtering conditions.
  • the spatial filtering condition includes spatial field prefix information
  • the generating a tree structure spatial index of the database table according to the spatial filtering condition includes:
  • the spatial filtering condition includes a filtering condition of a minimum bounding box operation type
  • the spatial prefix index of the database table is generated according to the spatial data encoded by the geospatial information standard byte stream and the spatial field prefix information.
  • the spatial field prefix information includes a condition for indicating the length of spatial data stored in the spatial field
  • the leaf node of the spatial prefix index does not save the spatial data.
  • the generating a tree structure spatial index of the database table according to the spatial filtering condition includes:
  • the spatial filtering condition obtain the information of the spatial field used to generate the tree structure spatial index
  • the composite spatial index is used as the tree structure spatial index.
  • the generating a tree structure spatial index of the database table according to the spatial filtering condition includes:
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for finding the next layer of pages .
  • the method further includes:
  • Creating the database table according to a database table creation command where the database table creation command includes an index creation command that generates the tree structure spatial index; or,
  • This application also provides a database query processing method, including:
  • query condition query the tree structure spatial index to obtain a query result.
  • the query conditions also include non-spatial fields
  • the querying the tree structure spatial index according to the query condition to obtain a query result includes:
  • the querying the composite spatial index of the database table according to the spatial query field of the query condition to obtain a query result that meets the query condition includes:
  • the candidate record that meets the query condition is queried from the composite spatial index of the database table according to the query condition, and the primary key of the candidate record is returned to the database table to further query to obtain The complete line record of the query condition.
  • the index coverage scan query on the composite spatial index of the database table according to the query condition includes:
  • performing index coverage scan query on the composite spatial index includes:
  • the database table is queried based on the primary key information.
  • the obtaining a query result that meets the query condition from the candidate record according to the spatial query field of the query condition includes:
  • the row record that matches the spatial query field is used as a query result that meets the query condition.
  • the spatial query information of the query condition is a minimum bounding box operation including spatial query fields.
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for finding the next layer of pages .
  • This application also provides a database index processing device, including:
  • a database table determination unit used to determine a database table to be created a database index; wherein, the database table includes a spatial field for storing spatial data;
  • a filtering condition obtaining unit configured to obtain a spatial filtering condition containing a spatial field identifier for the database table
  • An index generating unit configured to generate a tree-structured spatial index of the database table according to the spatial filtering conditions; wherein, the leaf nodes of the tree-structured spatial index store spatial data and primary keys that meet the spatial filtering conditions Logo.
  • This application also provides a database query processing device, including:
  • a database table determining unit used to determine a database table of spatial data to be queried; wherein, the database table includes a spatial field for storing spatial data;
  • a query condition determining unit used to obtain a query condition for the database table that includes a spatial query field
  • An index obtaining unit configured to obtain a tree structure spatial index of the database table; wherein, the leaf nodes of the tree structure spatial index store spatial data;
  • the query unit is configured to query the tree structure spatial index according to the query conditions to obtain query results.
  • This application also provides an electronic device, including:
  • Memory Memory, and processor
  • the memory is used to store computer executable instructions
  • the processor is used to execute the computer executable instructions:
  • the database table contains a spatial field for storing spatial data
  • a tree structure spatial index of the database table is generated; wherein, the leaf nodes of the tree structure spatial index store spatial data and primary key identifiers that meet the spatial filtering conditions.
  • This application also provides an electronic device, including:
  • Memory Memory, and processor
  • the memory is used to store computer executable instructions
  • the processor is used to execute the computer executable instructions:
  • query condition query the tree structure spatial index to obtain a query result.
  • the present application also provides a storage device that stores instructions that can be loaded by the processor and perform the following steps:
  • the database table contains a spatial field for storing spatial data
  • a tree structure spatial index of the database table is generated; wherein, the leaf nodes of the tree structure spatial index store spatial data and primary key identifiers that meet the spatial filtering conditions.
  • the present application also provides a storage device that stores instructions that can be loaded by the processor and perform the following steps:
  • query condition query the tree structure spatial index to obtain a query result.
  • the database index processing method provided in this application generates a tree-structured spatial index of the database table according to the spatial filtering conditions of the database table containing the spatial fields, and stores the spatial data that meets the spatial filtering conditions in the leaf nodes of the tree-structured spatial index Storing spatial data in the index can improve the query efficiency of spatial data, thus solving the problem of low query efficiency of spatial data.
  • the tree structure spatial index is a composite spatial index including non-spatial fields, it can also provide filtering of non-spatial columns, reduce the number of query operations that need to be returned to the table, and improve query efficiency.
  • the database query processing method provided in this application obtains the query result by querying the tree structure spatial index of the database table according to the query conditions including the spatial query field, because the leaf nodes of the data structure spatial index store spatial data, Therefore, the overhead of spatial data query is reduced, thereby solving the problem of low spatial data query efficiency.
  • the tree structure spatial index is a composite spatial index including non-spatial fields, it can also provide filtering of non-spatial columns, reduce the number of query operations that need to be returned to the table, and improve query efficiency.
  • FIG. 1 is a processing flowchart of a database index processing method provided by the first embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a database index provided by the first embodiment of the present application.
  • FIG. 3 is a processing flowchart of a database query processing method provided by a second embodiment of the present application.
  • FIG. 5 is a schematic diagram of a database index processing device provided by a third embodiment of the present application.
  • FIG. 6 is a schematic diagram of a database query processing device provided by a fourth embodiment of the present application.
  • FIG. 7 is a schematic diagram of an electronic device provided by a fifth embodiment of the present application.
  • This application provides a database index processing method, device, electronic device, and storage device. This application also relates to a database query processing method, device, electronic equipment, and storage equipment. Detailed descriptions will be made one by one in the following embodiments.
  • the first embodiment of the present application provides a database index processing method.
  • the processing method of the database index shown in FIG. 1 includes steps S101 to S103.
  • Step S101 Determine a database table to create a database index; wherein, the database table includes a spatial field for storing spatial data.
  • databases that support spatial data generally provide spatial indexes.
  • Traditional spatial indexes only store MBR information and/or MBB (Minimum bounding box) information, so further query operations are needed .
  • MBB and MBR refer to the minimum enclosing range that can cover spatial objects.
  • the minimum enclosing range that can cover spatial objects in two dimensions is the minimum enclosing matrix MBR, and the minimum enclosing range that can cover spatial objects in three dimensions is the minimum bounding box. MBB.
  • the query-back operation refers to that after querying and selecting candidate records that meet the spatial filtering conditions in the filtering conditions, the query returns to the primary key table for further query, obtains all fields, and judges whether other non-spatial filtering conditions in the filtering conditions are met.
  • the back-to-table query operation of the clustered index table is inefficient and slow, which results in low efficiency of spatial data query.
  • the so-called clustered index table is a common form of organization of database tables, which means that all records of the database table are organized together in the order of the primary key, the database table itself is stored in an index, and indexed by the primary key of the database table.
  • the database index generated based on the clustered index table is a secondary index of the database table.
  • the secondary index refers to a non-primary key index.
  • the processing method of the database index provided in this application can also be used for heap tables.
  • the leaf node of the tree structure spatial index of the obtained database table stores the spatial data that meets the spatial filtering conditions, and the queries that meet certain conditions directly obtain the query results from the tree structure spatial index of the database table Not all queries need to return to the table query operation to obtain complete records, thus making the business including spatial data query more efficient and efficient for spatial filtering queries.
  • This step is to determine the database table including the spatial field of the database index to be created.
  • the test table stores the GIS (Geo-Information) system spatial data with the GEOM field.
  • the type of GIS spatial data is Geometry.
  • GEOM is the field identifier (or field name) of the test table.
  • Geometry is a spatial data type supported by a database. It can be longitude information and latitude information representing geographic locations.
  • the test table also includes other non-spatial fields, that is, common fields, such as ID, int, NAME, varchar (500), PRICE, double, VERSION, int, Primary, key (id) and other fields, respectively corresponding to the integer type ID (ID), length It is a 500-character type NAME (name), a double-precision type PRICE (price), and the ID as the primary key, so that a record of the test table includes an object's identification, name, price and location information.
  • the GEOM field is a spatial field, and other fields that store non-spatial data are ordinary fields or non-spatial fields.
  • Step S102 Obtain a spatial filter condition for the database table that includes a spatial field identifier.
  • This step is to determine the spatial filtering conditions for generating spatial indexes, also known as filtering conditions.
  • the spatial filtering condition includes a spatial field
  • the index column of the tree structure spatial index obtained in the subsequent steps includes the spatial field
  • the spatial filtering condition includes a spatial field prefix.
  • the spatial data can be selectively stored in the tree structure index generated subsequently, that is, by the spatial field prefix
  • the constraint condition is determined according to the actual situation of the spatial data of the spatial field in the database table record, considering the balance between query efficiency and space occupation. For example, when space occupation is allowed, relax the conditions for storing spatial data in the index to store as much spatial data in the index as possible, which can improve query efficiency.
  • the spatial filtering condition further includes at least one of the following: a non-spatial field, and a non-spatial field prefix.
  • the spatial index generated in the subsequent steps according to different spatial filtering conditions includes different field types. If the spatial filter condition is a spatial field prefix, the resulting spatial index is the spatial prefix index, and the index column of the spatial prefix index includes the spatial field prefix; if the spatial filter condition includes the spatial field prefix and the non-spatial field, or, the spatial field prefix and the non-spatial field Spatial field prefix, or spatial field prefix, non-spatial field, non-spatial field prefix, then the subsequent spatial index is the composite prefix spatial index, the index column of the composite prefix spatial index includes the spatial field prefix, further, the composite prefix space
  • the index column of the index also includes at least one of the following: non-spatial fields, non-spatial field prefixes.
  • the index creation instruction information may be obtained during the database table creation stage, or the index creation instruction information may be obtained after the database table creation or after the database table has been created and data is inserted. This includes:
  • Creating the database table according to a database table creation command where the database table creation command includes an index creation command that generates the tree structure spatial index; or,
  • the index creation instruction information of the spatial index sck included in the above test table creation command includes the 30-byte prefix of the spatial field GEOM, the VERSION field, and the primary key ID automatically included as the secondary index. You can also use the create index method after creating the test table or after inserting data in the test table.
  • the index creation instruction information of the spatial index sck1 includes the 30-byte prefix of the spatial field GEOM, the PRICE field, and the The primary key ID automatically included in the secondary index, the command is as follows: create spatial key sck1(geom(20), price).
  • Step S103 Generate a tree structure spatial index of the database table according to the space filtering conditions; wherein, the leaf nodes of the tree structure spatial index store space data and primary key identifiers that meet the space filtering conditions.
  • This step is to generate a tree-structured spatial index that stores spatial data.
  • the tree structure spatial index of the database table is specifically generated by the following processing:
  • the spatial filtering condition obtain the information of the spatial field used to generate the tree structure spatial index
  • the composite spatial index is used as the tree structure spatial index.
  • the tree structure spatial index of the database table is generated by the following processing:
  • the index column of the generated tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data, and Look for the page ID of the next page.
  • the index column of the generated tree-structured spatial index includes spatial field prefix information; the non-leaf nodes of the tree-structured spatial index store a minimum value for retrieving the spatial data Bounding boxes and page identification to find the next layer of pages.
  • a tree structure spatial index of the database table is generated by the following processing:
  • the spatial filtering condition includes a filtering condition of a minimum bounding box operation type; correspondingly includes the following processing to generate a spatial prefix index of the database table according to the spatial field prefix information:
  • the spatial prefix index of the database table is generated according to the spatial data encoded by the geospatial information standard byte stream and the spatial field prefix information.
  • the so-called standard byte stream of geospatial information refers to WKB (The Well-known Binary), which uses a continuous binary stream to express geometry information.
  • the spatial field prefix information includes a condition for indicating the length of spatial data stored in the spatial field; correspondingly, the spatial data encoded according to the geospatial information standard byte stream And the spatial field prefix information to generate a spatial prefix index of the database table, specifically including:
  • the leaf node of the spatial prefix index does not save the spatial data.
  • FIG. 2 shows a schematic structural diagram of the compound prefix space index of the tree structure.
  • the structure of the composite prefix space index is the structure of the R-tree index.
  • 201 indicates that Root is the root node of the R-tree and stores the largest rectangular space; the non-leaf nodes indicated by 202 only store the minimum MBR enclosing for retrieval space Box and the pageid (page identifier) for finding the next page; the leaf node indicated by 203 and the non-leaf node indicated by 202 have different contents.
  • the content stored in the leaf node indicated by 203 is not only the MBR minimum bounding box, but also meets
  • the spatial data of the constraints contained in the spatial field prefix also includes conventional non-spatial fields, such as Col1 contained in 202 in the figure, and in this example, the VERSION field and the NAME field, and the composite prefix spatial index as a secondary index
  • the primary key PK primary key
  • the leaf node of the composite prefix space index also includes the ID field.
  • the second embodiment of the present application also provides a database query processing method.
  • FIG. 3 shows a processing method of a database query provided by the second embodiment of the present application. Since this embodiment is based on the first embodiment, the description is relatively simple. For related parts, please refer to the corresponding description of the first embodiment.
  • a processing method for database query provided by the second embodiment of the present application includes steps S301 to S304.
  • Step S301 Determine a database table of spatial data to be queried; wherein the database table includes a spatial field for storing spatial data.
  • This step is to determine the database table of the spatial data to be queried.
  • the database table is determined by obtaining a query command.
  • the query command is as follows:
  • a record of the test table includes the identification, name, price, and location information of an object.
  • the test table stores the GIS spatial data containing latitude and longitude information in the spatial field GEOM.
  • the test table also includes other non-spatial fields: ID, int, NAME, varchar (500), PRICE, double, VERSION, int, Primary, key (id) and other fields, respectively corresponding to the integer type ID (identification), the length of the 500 character type NAME (name), double precision type PRICE (price), the primary key is specified as the ID field.
  • the above query command is to select the ID, GEOM, and VERSION information in the records that satisfy the query conditions specified by the where statement from the test table.
  • the query conditions in this example include spatial query conditions and non-spatial query conditions.
  • Step S302 Obtain a query condition for the database table that includes a spatial query field.
  • This step is to determine the query conditions that include spatial query fields.
  • the spatial query information in the query condition includes a spatial query field
  • the spatial query information is specifically a minimum bounding box operation including the spatial query field.
  • the query condition further includes at least one of the following: a non-spatial field; a non-spatial field prefix.
  • Step S303 Obtain a tree structure spatial index of the database table; wherein, the leaf nodes of the tree structure spatial index store spatial data.
  • This step is to obtain the spatial index of the tree structure.
  • the embodiment of the present application specifically includes the following processing: obtaining a query condition for the database table, determining that the query condition includes a spatial query field, and acquiring a spatial index or a composite spatial index established for the database table.
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for searching for the next layer of pages.
  • the leaf node further includes a primary key identifier.
  • FIG. 2 shows a schematic structural diagram of the compound prefix space index of the tree structure.
  • the structure of the composite prefix space index is the structure of the R-tree index.
  • 201 indicates that Root is the root node of the R-tree and stores the largest rectangular space; the non-leaf nodes indicated by 202 only store the minimum MBR enclosing for retrieval space Box and the pageid (page identifier) for finding the next page; the leaf node indicated by 203 and the non-leaf node indicated by 202 have different contents.
  • the content stored in the leaf node indicated by 203 is not only the MBR minimum bounding box, but also meets
  • the spatial data of the constraints contained in the spatial field prefix also includes the conventional non-spatial field VERSION field and NAME field, and the composite prefix spatial index as a secondary index also automatically includes the primary key PK (primary) key, due to the test table
  • the primary key is ID, so the leaf node of the composite prefix spatial index also includes an ID field.
  • Step S304 Query the tree structure spatial index according to the query condition to obtain a query result.
  • This step is to query the tree structure spatial index according to the query conditions.
  • the query condition further includes a non-spatial field
  • the query result is specifically obtained through the following processing:
  • the embodiment of the present application specifically includes the following processing to obtain a query result that meets the query condition from the candidate record:
  • the row record that matches the spatial query field is used as a query result that meets the query condition.
  • the spatial query field according to the query condition is specifically determined by The composite spatial index is used for querying to obtain query results that meet the query conditions:
  • the candidate record that meets the query condition is queried from the composite spatial index of the database table according to the query condition, and the primary key of the candidate record is returned to the database table to further query to obtain The complete line record of the query condition.
  • an index coverage scan query is performed on the composite spatial index of the database table according to the query condition through the following processing:
  • the following process is specifically adopted to perform index coverage scan query on the composite spatial index according to the length condition contained in the prefix information of the spatial query field:
  • the database table is queried based on the primary key information.
  • FIG. 4 shows a flowchart of a specific implementation of a database query processing method provided in a second embodiment of the present application.
  • the figure includes:
  • the query starts, that is, the query command is received, and the query process is started.
  • query optimization that is, parsing the query command statement, dismantling the query conditions into tokens for use in subsequent processes.
  • S403 Determine whether to query through the spatial index.
  • the query conditions include spatial data geometric operators such as intersection, inclusion, orientation, distance, distance sorting, etc.
  • S404 Determine whether the composite spatial index includes the queried field, that is, determine whether the composite spatial index includes the field required for query in the query command. In the embodiment of the present application, it is determined whether the composite spatial index of the database table includes the field (or the column of the database table) required to be queried in the query command according to each token obtained by the disassembly. If the compound spatial index includes the fields required for query in the query command, go to S405; if the compound spatial index does not include the fields required for query in the query command, then go to S405-1.
  • S404-1 enter other non-spatial field index processing flow. That is, the spatial index query cannot be performed first, and the query needs to be performed based on the non-spatial field.
  • the following operations are performed: obtaining candidate records of non-spatial query fields in the database table that match the query conditions, and obtaining from the candidate records according to the spatial query fields of the query conditions Query results that meet the query conditions. Specifically, it includes the following processing:
  • the row record that matches the spatial query field is used as a query result that meets the query condition.
  • the complete data of each row of records needs to be queried out, and then the standard spatial calculation function is used to calculate whether it meets the geometric space operations such as intersection, inclusion, orientation, distance, and distance sorting in the query conditions.
  • S405 Determine whether the query space field is required in the query command. If the query command requires obtaining a spatial field, then go to S406; if the query command does not require obtaining a spatial field, then go to S406-1.
  • S406 Determine whether the length of the recorded spatial data meets the length condition of the spatial field prefix. If the length of the spatial data meets the length condition of the spatial field prefix, then go to S406-1; if the length of the spatial data does not meet the length condition of the spatial field prefix, then go to S405-1.
  • S406-1 Perform an index coverage scan operation, that is, perform a coverage scan on the composite spatial index to obtain the required query result.
  • the example of the query command of the database table of a database A is followed.
  • the above select command is to select the ID, GEOM, and VERSION information in the records that satisfy the query conditions specified by the where statement from the test table.
  • the query conditions in this example include spatial query conditions and non-spatial query conditions.
  • the spatial query conditions are MBRIntersects operations, non-
  • the spatial query condition is the VERSION condition, that is, version (2, 3).
  • condition is first a filter condition of minimum bounding box operation, which meets the query filtering method of the spatial index, and then, other filter conditions and query content are the index columns of the sck index. Therefore, execute S405; In addition, determine whether the spatial index query method can be used, and whether the spatial field of the composite spatial index has been subjected to conditional filtering that can be performed by the spatial index, such as bounding box operation, distance operation, etc., and whether the composite spatial index also contains other common Field filtering. In the process of executing S405, because the geom field is selected, the process moves to S406 to further determine the length condition of the spatial prefix.
  • the leaf node of the sck index can record the complete geom wkb information, so it can be transferred to S406-1 for index coverage scanning, if it is a very Large multipolygon (polygon), wkb code length exceeds 30 bytes, sck index has a record for this situation, according to the mark to return to the table query operation, that is, go to S405-1 and check the primary key index again to obtain geom Full record.
  • a third embodiment of the present application further provides a database index processing device.
  • FIG. 5 shows a schematic diagram of a database index processing device provided by a third embodiment of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For related parts, please refer to the corresponding description of the method embodiment.
  • This application provides a database index processing device, including:
  • the database table determination unit 501 is used to determine a database table to be created a database index; wherein, the database table includes a spatial field for storing spatial data;
  • a filtering condition obtaining unit 502 configured to obtain a spatial filtering condition containing a spatial field identifier for the database table
  • the index generating unit 503 is configured to generate a tree-structured spatial index of the database table according to the spatial filtering conditions; wherein, the leaf nodes of the tree-structured spatial index store spatial data that meets the spatial filtering conditions and Primary key ID.
  • the spatial filtering condition includes spatial field prefix information
  • the index generating unit 503 is specifically used to:
  • the spatial filtering condition includes a filtering condition of minimum bounding box operation type; the index generating unit 503 is specifically used to:
  • the spatial prefix index of the database table is generated according to the spatial data encoded by the geospatial information standard byte stream and the spatial field prefix information.
  • the spatial field prefix information includes a length condition used to indicate the spatial data stored in the spatial field;
  • the index generating unit 503 is specifically used to:
  • the leaf node of the spatial prefix index does not save the spatial data.
  • the index generating unit 503 is specifically used to:
  • the spatial filtering condition obtain the information of the spatial field used to generate the tree structure spatial index
  • the composite spatial index is used as the tree structure spatial index.
  • the index generating unit 503 is specifically used to:
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for searching for the next layer of pages.
  • the device further includes a command unit, the command unit is used for:
  • Creating the database table according to a database table creation command where the database table creation command includes an index creation command that generates the tree structure spatial index; or,
  • a fourth embodiment of the present application further provides a database query processing device.
  • FIG. 6 shows a schematic diagram of a database query processing apparatus provided in a fourth embodiment of the present application. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For related parts, please refer to the corresponding description of the method embodiment.
  • the processing device for database query shown in FIG. 6 includes:
  • the database table determination unit 601 is used to determine a database table of spatial data to be queried; wherein the database table includes a spatial field for storing spatial data;
  • the query condition determination unit 602 is used to obtain a query condition for the database table that includes a spatial query field
  • the index obtaining unit 603 is used to obtain a tree structure spatial index of the database table; wherein, the leaf nodes of the tree structure spatial index store spatial data;
  • the query unit 604 is configured to query the tree structure spatial index according to the query conditions to obtain query results.
  • the query condition also includes a non-spatial field; the query unit 604 is specifically used to:
  • the query unit 604 is specifically configured to: obtain a non-spatial query field of the query condition;
  • the candidate record that meets the query condition is queried from the composite spatial index of the database table according to the query condition, and the primary key of the candidate record is returned to the database table to further query to obtain The complete line record of the query condition.
  • the query unit 604 includes an index coverage scanning subunit, and the index coverage scanning subunit is used to determine whether it is a spatial field of a composite spatial index querying the database table according to the spatial query field;
  • the index coverage scanning subunit is specifically used to: obtain the length condition included in the prefix information of the spatial query field;
  • the query unit 604 is specifically used to:
  • the row record that matches the spatial query field is used as a query result that meets the query condition.
  • the spatial query information of the query condition is a minimum bounding box operation including spatial query fields.
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for searching for the next layer of pages.
  • the leaf node also includes a primary key identifier.
  • the fifth embodiment of the present application also provides an electronic device for implementing the processing method of the database index, referring to FIG. 7, which shows an electronic device provided by the fifth embodiment Schematic.
  • a fifth embodiment of the present application provides an electronic device, including:
  • Memory 701, and processor 702 are examples of processor 701, and processor 702;
  • the memory 701 is used to store computer executable instructions, and the processor 702 is used to execute the computer executable instructions:
  • the database table contains a spatial field for storing spatial data
  • a tree structure spatial index of the database table is generated; wherein, the leaf nodes of the tree structure spatial index store spatial data and primary key identifiers that meet the spatial filtering conditions.
  • the spatial filtering condition includes spatial field prefix information; the processor 702 is further configured to execute the following computer-executable instructions:
  • the spatial filtering condition includes a filtering condition of minimum bounding box operation type; the processor 702 is further configured to execute the following computer-executable instructions:
  • the spatial prefix index of the database table is generated according to the spatial data encoded by the geospatial information standard byte stream and the spatial field prefix information.
  • the spatial field prefix information includes a condition for indicating the length of spatial data stored in the spatial field; the processor 702 is also used to execute the following computer-executable instructions:
  • the leaf node of the spatial prefix index does not save the spatial data.
  • processor 702 is further configured to execute the following computer-executable instructions:
  • the spatial filtering condition obtain the information of the spatial field used to generate the tree structure spatial index
  • the composite spatial index is used as the tree structure spatial index.
  • processor 702 is further configured to execute the following computer-executable instructions:
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for finding the next layer of pages .
  • processor 702 is further configured to execute the following computer-executable instructions:
  • Creating the database table according to a database table creation command where the database table creation command includes an index creation command that generates the tree structure spatial index; or,
  • the sixth embodiment of the present application also provides an electronic device for implementing the processing method of the database query, and the structure thereof is similar to FIG. 7.
  • the sixth embodiment of the present application provides an electronic device, including:
  • Memory Memory, and processor
  • the memory is used to store computer executable instructions
  • the processor is used to execute the computer executable instructions:
  • the memory is used to store computer executable instructions
  • the processor is used to execute the computer executable instructions:
  • query condition query the tree structure spatial index to obtain a query result.
  • the leaf node further includes a primary key identifier.
  • the query condition further includes a non-spatial field; the processor is also used to execute the following computer-executable instructions:
  • the processor is also used to execute the following computer-executable instructions:
  • the candidate record that meets the query condition is queried from the composite spatial index of the database table according to the query condition, and the primary key of the candidate record is returned to the database table to further query to obtain The complete line record of the query condition.
  • the processor is also used to execute the following computer-executable instructions:
  • the processor is also used to execute the following computer-executable instructions:
  • the database table is queried based on the primary key information.
  • the processor is also used to execute the following computer-executable instructions:
  • the row record that matches the spatial query field is used as a query result that meets the query condition.
  • the spatial query information of the query condition is a minimum bounding box operation including spatial query fields.
  • the index column of the tree-structured spatial index includes a spatial field; the non-leaf nodes of the tree-structured spatial index store a minimum bounding box for retrieving the spatial data and a page identifier for finding the next layer of pages .
  • the seventh embodiment of the present application also provides a storage device, which is described relatively simply.
  • a storage device which is described relatively simply.
  • related parts please refer to the corresponding descriptions in the above embodiments.
  • This application provides a storage device that stores instructions that can be loaded by a processor and perform the following steps:
  • the database table contains a spatial field for storing spatial data
  • a tree structure spatial index of the database table is generated; wherein, the leaf nodes of the tree structure spatial index store spatial data and primary key identifiers that meet the spatial filtering conditions.
  • the eighth embodiment of the present application also provides a storage device, which is described relatively simply.
  • a storage device which is described relatively simply.
  • related parts please refer to the corresponding descriptions in the foregoing embodiments.
  • This application provides a storage device that stores instructions that can be loaded by a processor and perform the following steps:
  • the memory is used to store computer executable instructions
  • the processor is used to execute the computer executable instructions:
  • query condition query the tree structure spatial index to obtain a query result.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory, random access memory (RAM) and/or non-volatile memory in computer-readable media, such as read only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read only memory
  • flash RAM flash random access memory
  • Computer-readable media including permanent and non-permanent, removable and non-removable media, can implement information storage by any method or technology.
  • the information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program code.
  • computer usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种数据库索引以及数据库查询的处理方法、装置及设备,包括:确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;获得针对所述数据库表的包含空间字段标识的空间过滤条件;根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。提升了空间数据相关的查询的效率。

Description

数据库索引以及数据库查询的处理方法、装置及设备
本申请要求2018年11月27日递交的申请号为201811422523.X、发明名称为“数据库索引以及数据库查询的处理方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理领域,具体涉及一种数据库索引的处理方法、装置、电子设备以及存储设备。本申请同时涉及一种数据库查询的处理方法、装置、电子设备以及存储设备。
背景技术
随着计算机与信息技术的发展,空间数据以及支持存储和管理空间数据的数据库在多种行业得到了广泛应用,例如,用于城市规划、交通、银行、航空航天等。所谓空间数据,又称几何数据,是一种计算机能够处理的用于表示包含空间坐标的信息的特殊类型的数据,例如,表示建筑设计图、机械设计图、地图的空间数据。空间数据能够定量描述现实世界中有定位意义的事物和现象,例如标识空间实体的位置、形状大小、分布特征。所谓空间实体是对地理事物和现象进行抽象得到的结果,也称地理实体或实体。
目前,支持存储和管理空间数据的数据库一般提供空间索引,用于对数据库存储的空间数据进行快速读取和完整性检查。所谓空间索引是依据空间对象的位置和形状或空间对象之间的某种空间关系按一定的顺序排列的一种数据结构。现有的空间索引只存储了能够覆盖空间对象的MBR(Minimum bounding rectangle,最小包围盒)的信息。所谓MBR是指二维情况下能够覆盖空间对象的最小包围矩阵。当查询空间数据时,先筛选出符合空间过滤条件的空间数据,之后需要回主键表中进行进一步的过滤以获取完整记录。因而,当查询中匹配上空间过滤条件的记录数量比较庞大时,回主键表获取完整记录的CPU及IO开销较大,导致空间数据查询效率比较低。
发明内容
本申请提供一种数据库索引的处理方法、数据库查询的处理方法,以提升空间数据的查询效率。
本申请提供一种数据库索引的处理方法,包括:
确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间字段标识的空间过滤条件;
根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
可选的,所述空间过滤条件包含空间字段前缀信息;
所述根据所述空间过滤条件,生成所述数据库表的树型结构空间索引,包括:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀信息;
根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引;其中,所述空间前缀索引的索引列包括所述空间字段前缀信息;
将所述空间前缀索引作为所述树型结构空间索引。
可选的,所述空间过滤条件包括最小包围盒运算类型的过滤条件;
所述根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引,包括:
根据所述最小包围盒运算类型的过滤条件,对所述数据库表进行最小包围盒过滤,得到符合所述最小包围盒运算类型的过滤条件的备选空间字段;
针对所述备选空间字段存储的空间数据进行地理空间信息标准字节流编码;
根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引。
可选的,所述空间字段前缀信息包含用于指示空间字段存储的空间数据的长度条件;
所述根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引,包括:
获得所述地理空间信息标准字节流编码后的空间数据的长度;
根据所述空间字段前缀信息获得所述长度条件;
如果地理空间信息标准字节流编码后的空间数据的长度符合所述长度条件,则在所述空间前缀索引的叶子节点存储符合长度条件的空间数据;
否则,所述空间前缀索引的叶子节点不保存所述空间数据。
可选的,所述根据所述空间过滤条件,生成所述数据库表的树型结构空间索引,包括:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段的信息和所述非空间字段的信息,生成所述数据库表的复合空间索引;其中,所述空间复合索引的索引列包括所述空间字段以及所述非空间字段;
将所述复合空间索引作为所述树型结构空间索引。
可选的,所述根据所述空间过滤条件,生成所述数据库表的树型结构空间索引,包括:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段前缀的信息和所述非空间字段的信息,生成复合前缀空间索引;其中,所述复合前缀空间索引的索引列包括所述空间字段前缀以及所述非空间字段;
将所述空间复合前缀索引作为所述树型结构空间索引。
可选的,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
可选的,所述方法还包括:
根据数据库表创建命令创建所述数据库表,在所述数据库表创建命令中包括生成所述树型结构空间索引的索引创建命令;或者,
根据索引创建命令创建所述树型结构空间索引。
本申请还提供一种数据库查询的处理方法,包括:
确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间查询字段的查询条件;
获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
可选的,所述查询条件还包括非空间字段;
所述根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果,包括:
获得所述查询条件的空间字段;
判断所述空间字段是否匹配所述树型结构空间索引的索引列的空间字段标识;
如果是,则根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进 行查询,得到符合所述查询条件的查询结果;
如果否,则获取所述数据库表中匹配所述查询条件的非空间查询字段的备选记录,根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果。
可选的,所述根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果,包括:
获得所述查询条件的非空间查询字段;
判断所述空间查询字段和所述非空间查询字段为所述数据库表的复合空间索引包括的索引列;
如果是,则确定所述查询条件符合针对所述数据库表的符合空间索引查询方式,根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询;
如果否,则根据所述查询条件从所述数据库表的复合空间索引中查询到符合所述查询条件的备选记录,根据所述备选记录的主键,回所述数据库表进一步查询得到符合所述查询条件的完整的行记录。
可选的,所述根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询,包括:
根据所述空间查询字段判断是否为查询所述数据库表的复合空间索引的空间字段;
如果是,根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询;
如果否,对数据库表的复合空间索引进行索引覆盖扫描查询。
可选的,所述根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询,包括:
获得所述空间查询字段的前缀信息包含的长度条件;
判断复合空间索引的行记录的长度是否满足所述长度条件,如果满足所述长度条件,则将所述行记录作为索引覆盖扫描查询结果;
如果否,则根据主键信息对所述数据库表进行查询。
可选的,所述根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果,包括:
对所述备选的行记录的数据进行空间计算,根据计算结果从所述备选的行记录中获得符合所述空间查询字段的行记录;
将所述符合所述空间查询字段的行记录作为符合所述查询条件的查询结果。
可选的,所述查询条件的空间查询信息为包括空间查询字段的最小包围盒运算。
可选的,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
本申请还提供一种数据库索引的处理装置,包括:
数据库表确定单元,用于确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
过滤条件获得单元,用于获得针对所述数据库表的包含空间字段标识的空间过滤条件;
索引生成单元,用于根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
本申请还提供一种数据库查询的处理装置,包括:
数据库表确定单元,用于确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
查询条件确定单元,用于获得针对所述数据库表的包含空间查询字段的查询条件;
索引获得单元,用于获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
查询单元,用于根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
本申请还提供一种电子设备,包括:
存储器,以及处理器;
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间字段标识的空间过滤条件;
根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
本申请还提供一种电子设备,包括:
存储器,以及处理器;
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间查询字段的查询条件;
获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
本申请还提供一种存储设备,存储有指令,所述指令能够被处理器加载并执行以下步骤:
确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间字段标识的空间过滤条件;
根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
本申请还提供一种存储设备,存储有指令,所述指令能够被处理器加载并执行以下步骤:
确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间查询字段的查询条件;
获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
与现有技术相比,本申请具有以下优点:
本申请提供的数据库索引的处理方法,通过根据包含空间字段的数据库表的空间过滤条件,生成数据库表的树型结构空间索引,在树型结构空间索引的叶子节点存储符合空间过滤条件的空间数据,在索引中存放空间数据能够提升空间数据的查询效率,从而解决了空间数据查询效率低的问题。进一步的,当所述树型结构空间索引为包括非空间 字段的复合空间索引时,还能提供非空间列的过滤,减少需要回表查询操作的次数,提高查询效率。
本申请提供的数据库查询的处理方法,通过根据包含空间查询字段的查询条件,对数据库表的树型结构空间索引进行查询得到查询结果,由于所述数据结构空间索引的叶子节点存储有空间数据,因此降低了空间数据查询的开销,从而解决了空间数据查询效率低的问题。进一步的,当所述树型结构空间索引为包括非空间字段的复合空间索引时,还能提供非空间列的过滤,减少需要回表查询操作的次数,提高查询效率。
附图说明
图1是本申请第一实施例提供的数据库索引的处理方法的处理流程图;
图2是本申请第一实施例提供的数据库索引的结构示意图;
图3是本申请第二实施例提供的数据库查询的处理方法的处理流程图;
图4是本申请第二实施例提供的数据库查询的实际实现的流程图;
图5是本申请第三实施例提供的数据库索引的处理装置示意图;
图6是本申请第四实施例提供的数据库查询的处理装置示意图;
图7是本申请第五实施例提供的电子设备示意图。
具体实施方式
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施的限制。
本申请提供一种数据库索引的处理方法、装置、电子设备以及存储设备。本申请同时涉及一种数据库查询的处理方法、装置、电子设备以及存储设备。在下面的实施例中逐一进行详细说明。
本申请第一实施例提供一种数据库索引的处理方法。
以下结合图1和图2对本申请实施例提供的数据库索引的处理方法进行说明。
图1所示的数据库索引的处理方法,包括:步骤S101至步骤S103。
步骤S101,确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段。
实际应用中,支持空间数据的数据库一般提供空间索引,传统的空间索引由于只存 储了MBR的信息和/或MBB(Minimum bounding box,最小限定箱)的信息,因此还需要进一步进行回表查询操作。所谓MBB以及MBR是指能够覆盖空间对象的最小包围范围,在二维情况下能够覆盖空间对象的最小包围范围为最小包围矩阵MBR,在三维情况下能够覆盖空间对象的最小包围范围为最小限定箱MBB。所述回表查询操作是指查询筛选出符合过滤条件中的空间过滤条件的备选记录后,回到主键表中进一步查询,获取所有字段,判断是否符合过滤条件中的其他非空间过滤条件。以聚集索引表的数据库为例,聚集索引表的回表查询操作效率低、速度慢,这会导致空间数据查询效率低。所谓聚集索引表是数据库表的一种常用组织形式,是指数据库表的所有记录按照主键顺序组织在一起,数据库表本身就以索引的方式存储,通过数据库表的主键进行索引。基于聚集索引表生成的数据库索引为数据库表的二级索引。所述二级索引是指非主键索引。另外,当查询中匹配上空间过滤条件的记录数量比较庞大时,回表查询操作获取完整记录的CPU及IO开销较大,也导致空间数据查询效率比较低。需要说明的是,本申请提供的数据库索引的处理方法也可用于堆表。
本申请提出的数据库索引的处理方法,得到的数据库表的树型结构空间索引的叶子节点存储符合空间过滤条件的空间数据,满足一定条件的查询直接从数据库表的树型结构空间索引获得查询结果,而不是所有的查询都需要回表查询操作获取完整记录,因而使得包括空间数据查询的业务对于空间过滤的查询更加快捷高效。
本步骤是确定待创建数据库索引的包括空间字段的数据库表。举例如下,以某数据库A的数据库表test为例(test为表名称)。test表以GEOM字段存储GIS(Geo-Information system,地理信息系统)空间数据,GIS空间数据的类型为Geometry类型。GEOM是test表的字段标识(或称为字段名称),Geometry是某数据库支持的一种空间数据类型,可以是表示地理位置的经度信息、纬度信息。test表中还包括其他非空间字段,即普通字段,例如ID int,NAME varchar(500),PRICE double,VERSION int,Primary key(id)等字段,分别对应整型类型的ID(标识),长度为500的字符类型的NAME(名称),双精度类型的PRICE(价格),并将ID作为主键,这样test表的一条记录包括了某个对象的标识、名称、价格及位置信息。GEOM字段为空间字段,其他存储非空间数据的字段为普通字段或非空间字段。
步骤S102,获得针对所述数据库表的包含空间字段标识的空间过滤条件。
本步骤是确定生成空间索引的空间过滤条件,也称为过滤条件。
本申请实施例提供的一个实施方式中,所述空间过滤条件包括空间字段,相应后续 步骤得到的树型结构空间索引的索引列包括空间字段。
本申请实施例提供的另一个实施方式中,所述空间过滤条件包括空间字段前缀,通过使用空间字段前缀,可以有选择的在后续生成的树型结构索引中存放空间数据,即通过空间字段前缀定义或规定索引中存放的空间数据的约束条件。具体的,根据数据库表记录中空间字段的空间数据的实际情况考虑查询效率和空间占用的平衡确定所述约束条件。例如,当空间占用允许时,则放宽索引中存放空间数据的条件,以尽可能多的在索引中存放空间数据,可以提升查询效率。
进一步的,所述空间过滤条件还包括下述至少一项:非空间字段,非空间字段前缀。根据空间过滤条件的不同后续步骤中生成的空间索引包括的字段类型也不同。如果空间过滤条件为空间字段前缀则得到的空间索引为空间前缀索引,空间前缀索引的索引列包括空间字段前缀;如果空间过滤条件包括空间字段前缀和非空间字段,或者,包括空间字段前缀和非空间字段前缀,或者,为空间字段前缀、非空间字段、非空间字段前缀,则后续得到的空间索引为复合前缀空间索引,复合前缀空间索引的索引列包括空间字段前缀,进一步的,复合前缀空间索引的索引列还包括下述至少一项:非空间字段、非空间字段前缀。
本申请实施例中,可以在数据库表创建阶段获得索引创建指示信息,也可以在数据库表创建之后或者在数据库表已经创建并插入数据之后获得索引创建指示信息。具体包括:
根据数据库表创建命令创建所述数据库表,在所述数据库表创建命令中包括生成所述树型结构空间索引的索引创建命令;或者,
根据索引创建命令创建所述树型结构空间索引。
沿用某数据库A的数据库表test的例子。以如下命令创建test是获得创建空间索引sck的索引创建指示信息:
Create table test(
ID int,
NAME varchar(500),
PRICE double,
GEOM.Geometry,
VERSION int,
Primary key(id),
Spatial key sck(geom(30),version)
);
上述test表创建命令包括的空间索引sck的索引创建指示信息包括空间字段GEOM的30字节前缀、VERSION字段、以及作为二级索引自动包含的主键ID。也可以在创建test表之后或者在test表中插入数据之后,使用create index(创建索引)方式创建,例如空间索引sck1的索引创建指示信息包括空间字段GEOM的30字节前缀、PRICE字段、以及作为二级索引自动包含的主键ID,命令如下:create spatial key sck1(geom(20),price)。
步骤S103,根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
本步骤是生成存放了空间数据的树形结构空间索引。
本申请实施例中,当空间过滤条件包括空间字段和非空间字段,具体通过下述处理生成所述数据库表的树型结构空间索引:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段的信息和所述非空间字段的信息,生成所述数据库表的复合空间索引;其中,所述空间复合索引的索引列包括所述空间字段以及所述非空间字段;
将所述复合空间索引作为所述树型结构空间索引。
本申请实施例中,当空间过滤条件包括空间字段前缀的信息和非空间字段的信息,具体通过下述处理生成所述数据库表的树型结构空间索引:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段前缀的信息和所述非空间字段的信息,生成复合前缀空间索引;其中,所述复合前缀空间索引的索引列包括所述空间字段前缀以及所述非空间字段;
将所述空间复合前缀索引作为所述树型结构空间索引。
本申请实施例提供的一个具体实施方式中,生成的树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
本申请实施例提供的另一个具体实施方式中,生成的树型结构空间索引的索引列包 括空间字段前缀信息;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。具体通过下述处理生成所述数据库表的树型结构空间索引:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀信息;
根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引;其中,所述空间前缀索引的索引列包括所述空间字段前缀信息;
将所述空间前缀索引作为所述树型结构空间索引。
进一步的,所述空间过滤条件包括最小包围盒运算类型的过滤条件;相应包括下述处理根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引:
根据所述最小包围盒运算类型的过滤条件,对所述数据库表进行最小包围盒过滤,得到符合所述最小包围盒运算类型的过滤条件的备选空间字段;
针对所述备选空间字段存储的空间数据进行地理空间信息标准字节流编码;
根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引。
所谓地理空间信息标准字节流,是指WKB(The Well-known Binary),用连续的二进制流来表达几何体的信息。
本申请实施例提供的一个具体实施方式中,所述空间字段前缀信息包含用于指示空间字段存储的空间数据的长度条件;相应的,所述根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引,具体包括:
获得所述地理空间信息标准字节流编码后的空间数据的长度;
根据所述空间字段前缀信息获得所述长度条件;
如果地理空间信息标准字节流编码后的空间数据的长度符合所述长度条件,则在所述空间前缀索引的叶子节点存储符合长度条件的空间数据;
否则,所述空间前缀索引的叶子节点不保存所述空间数据。
沿用某数据库A的数据库表test的例子,基于GEOM、VERSION、NAME生成树型结构的复合前缀空间索引,其索引结构请参考图2。图2示出了所述树型结构的复合前缀空间索引的结构示意图。该复合前缀空间索引的结构为R树索引的结构,图中201指示Root为R树的根节点,存储了最大的矩形空间;202指示的非叶子节点中只存储有用于检索空间的MBR最小包围盒以及寻找下一页面的pageid(页面标识);203指示的叶子节点和202指示的非叶子节点存储的内容不同,203指示的叶子节点中存储的内容 除了MBR最小包围盒之外,还有满足空间字段前缀包含的约束条件的空间数据,当然还包括常规的非空间字段,例如图中202包含的Col1,具体到本例子则为VERSION字段和NAME字段,以及作为二级索引的复合前缀空间索引还自动包含的主键PK(primary key),见图中202包含的PK,具体到本例子,由于test表的主键为ID,因此复合前缀空间索引的叶子节点中还包括ID字段。
以上述第一实施例为基础,本申请第二实施例还提供一种数据库查询的处理方法。
参照图3,其示出了本申请第二实施例提供的数据库查询的处理方法。由于本实施例以第一实施例为基础,所以描述得比较简单,相关的部分请参见第一实施例的对应说明即可。
本申请第二实施例提供的一种数据库查询的处理方法,包括:步骤S301至步骤S304。
步骤S301,确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段。
本步骤是确定待查询空间数据的数据库表。
本申请实施例中通过获得查询命令确定所述数据库表。沿用某数据库A的数据库表test的例子,查询命令举例如下:
select ID,GEOM,VERSION from test where MBRIntersects(GEOM,,ST_GeomFromTe xt('POLYGON((113.22779059410095 23.077155641028952,113.22927117347716 23.077155641028952,113.22927117347716 23.078517734365768,113.22779059410095 23.078517734365768,113.22779059410095 23.077155641028952))',4326))and version in(2,3);
test表的一条记录包括了某个对象的标识、名称、价格及位置信息,test表以空间字段GEOM存储了包含经纬度信息的GIS空间数据。test表中还包括其他非空间字段:ID int,NAME varchar(500),PRICE double,VERSION int,Primary key(id)等字段,分别对应整型类型的ID(标识),长度为500的字符类型的NAME(名称),双精度类型的PRICE(价格),主键指定为ID字段。上述查询命令为从test表中选择满足where语句指定的查询条件的记录中的ID、GEOM、VERSION信息,本举例中查询条件包含空间查询条件和非空间查询条件。
步骤S302,获得针对所述数据库表的包含空间查询字段的查询条件。
本步骤是确定包含空间查询字段的查询条件。
本申请实施例中,在所述查询条件的空间查询信息中包括空间查询字段,所述空间 查询信息具体为包括空间查询字段的最小包围盒运算。
沿用上述针对某数据库A的数据库表test的查询命令的例子,上述命令的where语句中的
MBRIntersects(GEOM,,ST_GeomFromText('POLYGON((113.22779059410095 23.077155641028952,113.22927117347716 23.077155641028952,113.22927117347716 23.078517734365768,113.22779059410095 23.078517734365768,113.22779059410095 23.077155641028952))',4326))
为判断是否交叉或重叠的最小包围盒运算。
本申请实施例中,所述查询条件还包括下述至少一项:非空间字段;非空间字段前缀。
步骤S303,获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据。
本步骤是获得树型结构空间索引。
本申请实施例中,具体包括下述处理:获得针对所述数据库表的查询条件,确定所述查询条件包含空间查询字段,获取针对所述数据库表建立的空间索引或复合空间索引。具体的,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。优选的,所述叶子节点还包括主键标识。
沿用某数据库A的数据库表test的例子,获得针对test表的基于GEOM、VERSION、NAME生成树型结构的复合前缀空间索引,其索引结构请参考图2。图2示出了所述树型结构的复合前缀空间索引的结构示意图。该复合前缀空间索引的结构为R树索引的结构,图中201指示Root为R树的根节点,存储了最大的矩形空间;202指示的非叶子节点中只存储有用于检索空间的MBR最小包围盒以及寻找下一页面的pageid(页面标识);203指示的叶子节点和202指示的非叶子节点存储的内容不同,203指示的叶子节点中存储的内容除了MBR最小包围盒之外,还有满足空间字段前缀包含的约束条件的空间数据,当然还包括常规的非空间字段VERSION字段和NAME字段,以及作为二级索引的复合前缀空间索引还自动包含的主键PK(primary key),由于test表的主键为ID,因此复合前缀空间索引的叶子节点中还包括ID字段。
步骤S304,根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
本步骤是根据所述查询条件,对所述树型结构空间索引进行查询。
本申请实施例中,所述查询条件还包括非空间字段,具体通过下述处理得到查询结果:
获得所述查询条件的空间字段;
判断所述空间字段是否匹配所述树型结构空间索引的索引列的空间字段标识;
如果是,则根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果;
如果否,则获取所述数据库表中匹配所述查询条件的非空间查询字段的备选记录,根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果。本申请实施例中,具体包括下述处理从所述备选记录中获得符合所述查询条件的查询结果:
对所述备选的行记录的数据进行空间计算,根据计算结果从所述备选的行记录中获得符合所述空间查询字段的行记录;
将所述符合所述空间查询字段的行记录作为符合所述查询条件的查询结果。
本申请实施例中,如果判断所述空间字段匹配所述树型结构空间索引的索引列的空间字段标识,则具体通过下述处理根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果:
获得所述查询条件的非空间查询字段;
判断所述空间查询字段和所述非空间查询字段为所述数据库表的复合空间索引包括的索引列;
如果是,则确定所述查询条件符合针对所述数据库表的符合空间索引查询方式,根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询;
如果否,则根据所述查询条件从所述数据库表的复合空间索引中查询到符合所述查询条件的备选记录,根据所述备选记录的主键,回所述数据库表进一步查询得到符合所述查询条件的完整的行记录。
具体的,通过下述处理根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询:
根据所述空间查询字段判断是否为查询所述数据库表的复合空间索引的空间字段;
如果是,根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询;
如果否,对数据库表的复合空间索引进行索引覆盖扫描查询。
本申请实施例中,具体采用下述处理根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询:
获得所述空间查询字段的前缀信息包含的长度条件;
判断复合空间索引的行记录的长度是否满足所述长度条件,如果满足所述长度条件,则将所述行记录作为索引覆盖扫描查询结果;
如果否,则根据主键信息对所述数据库表进行查询。
请参考图4。图4示出了本申请第二实施例提供的数据库查询的处理方法的一种具体实现的流程图。图中包括:
S401,查询开始,即收到查询命令,启动查询流程。
S402,查询优化,即解析查询命令的语句,将查询条件拆解成各个token以备后续流程中使用。
S403,判断是否通过空间索引进行查询。本申请实施例中,当查询条件中包含空间数据几何操作符例如相交、包含、方位、距离、距离排序等,则判断优先使用空间索引。如果是,则转入S404;如果否,则转入S404-1。
S404,判断复合空间索引是否包含查询的字段,即判断复合空间索引是否包含查询命令中要求查询的字段。本申请实施例中根据拆解得到的各个token判断数据库表的复合空间索引是否包括查询命令中要求查询的字段(或数据库表的列)。如果复合空间索引包括查询命令中要求查询的字段转入S405;如果复合空间索引不包括查询命令中要求查询的字段,则转入S405-1。
S404-1,进入其他非空间字段索引处理流程。即不能优先进行空间索引查询,需要根据非空间字段查询。本申请实施例中,进行下述操作:获取所述数据库表中匹配所述查询条件的非空间查询字段的备选记录,根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果。具体的,包括下述处理:
对所述备选的行记录的数据进行空间计算,根据计算结果从所述备选的行记录中获得符合所述空间查询字段的行记录;
将所述符合所述空间查询字段的行记录作为符合所述查询条件的查询结果。
该处理中由于需要将每一行记录的完整数据查询出来,之后使用标准的空间计算函数来计算是否符合查询条件中的相交、包含、方位、距离、距离排序等几何空间操作。
S405,判断查询命令中是否要求查询空间字段。如果查询命令中要求获取空间字段,则转入S406;如果查询命令中不要求获取空间字段,则转入S406-1。
S405-1,进行回表查询操作,具体包括筛选出符合查询条件中的空间查询条件的备选记录后,回到主键表中进一步查询,获取所有字段,判断是否符合查询条件中的其他非空间查询条件。
S406,判断记录的空间数据的长度是否满足空间字段前缀的长度条件。如果空间数据的长度满足空间字段前缀的长度条件,则转入S406-1;如果空间数据的长度不满足空间字段前缀的长度条件,则转入S405-1。
S406-1,进行索引覆盖扫描操作,即对所述复合空间索引进行覆盖扫描获得需要的查询结果。
沿用某数据库A的数据库表test查询命令的例子。上述select命令为从test表中选择满足where语句指定的查询条件的记录中的ID、GEOM、VERSION信息,本举例中查询条件包含空间查询条件和非空间查询条件,空间查询条件为MBRIntersects运算,非空间查询条件为VERSION条件,即version in(2,3)。创建test表时建立了复合前缀空间索引sck,sck记录了GEOM字段的30字节前缀,VERSION,以及作为二级索引自动包含的主键ID。在查询query中where条件里首先是有一个最小包围盒运算的过滤条件,符合空间索引的查询过滤方式,然后,其他的过滤条件以及查询的内容都是sck这个索引的索引列因此,执行S405;此外,判断是否可以采用空间索引查询方式,还可以判断复合空间索引的空间字段是否进行了空间索引能进行的条件过滤,例如,包围盒运算、距离运算等,以及复合空间索引是否还包含其他普通字段的筛选。执行S405过程中,由于select了geom字段,因此转入S406,进一步判断空间前缀的长度条件,如果索引中符合包围盒过滤的结果中的geom利用wkb编码后结果是小于30个字节,比如是point(113.228,23.078),相应的,该point的wkb长度为25,则sck索引的叶子节点中能够记录了完整的geom wkb信息,因此可以转入S406-1进行索引覆盖扫描,如果是一个非常大的multi polygon(多边形),wkb编码长度超过30字节,sck索引上对这种情形的记录有标识,根据标识进行回表查询操作,即转入S405-1再查一次主键索引来获取geom的完整记录。
与本申请第一实施例提供的一种数据库索引的处理方法相对应,本申请第三实施例还提供了一种数据库索引的处理装置。
参照图5,其示出了本申请第三实施例提供的数据库索引的处理装置示意图。由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关的部分请参见方法实施 例的对应说明即可。
本申请提供一种数据库索引的处理装置,包括:
数据库表确定单元501,用于确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
过滤条件获得单元502,用于获得针对所述数据库表的包含空间字段标识的空间过滤条件;
索引生成单元503,用于根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
其中,所述空间过滤条件包含空间字段前缀信息;所述索引生成单元503具体用于:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀信息;
根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引;其中,所述空间前缀索引的索引列包括所述空间字段前缀信息;
将所述空间前缀索引作为所述树型结构空间索引。
其中,所述空间过滤条件包括最小包围盒运算类型的过滤条件;所述索引生成单元503具体用于:
根据所述最小包围盒运算类型的过滤条件,对所述数据库表进行最小包围盒过滤,得到符合所述最小包围盒运算类型的过滤条件的备选空间字段;
针对所述备选空间字段存储的空间数据进行地理空间信息标准字节流编码;
根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引。
其中,所述空间字段前缀信息包含用于指示空间字段存储的空间数据的长度条件;所述索引生成单元503具体用于:
获得所述地理空间信息标准字节流编码后的空间数据的长度;
根据所述空间字段前缀信息获得所述长度条件;
如果地理空间信息标准字节流编码后的空间数据的长度符合所述长度条件,则在所述空间前缀索引的叶子节点存储符合长度条件的空间数据;
否则,所述空间前缀索引的叶子节点不保存所述空间数据。
其中,所述索引生成单元503具体用于:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段的信息和所述非空间字段的信息,生成所述数据库表的复合空间索引;其中,所述空间复合索引的索引列包括所述空间字段以及所述非空间字段;
将所述复合空间索引作为所述树型结构空间索引。
其中,所述索引生成单元503具体用于:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段前缀的信息和所述非空间字段的信息,生成复合前缀空间索引;其中,所述复合前缀空间索引的索引列包括所述空间字段前缀以及所述非空间字段;
将所述空间复合前缀索引作为所述树型结构空间索引。
其中,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
其中,所述装置还包括命令单元,所述命令单元用于:
根据数据库表创建命令创建所述数据库表,在所述数据库表创建命令中包括生成所述树型结构空间索引的索引创建命令;或者,
根据索引创建命令创建所述树型结构空间索引。
与本申请第二实施例提供的一种数据库查询的处理方法相对应,本申请第四实施例还提供了一种数据库查询的处理装置。
参照图6,其示出了本申请第四实施例提供的数据库查询的处理装置示意图。由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关的部分请参见方法实施例的对应说明即可。
图6所示的数据库查询的处理装置,包括:
数据库表确定单元601,用于确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
查询条件确定单元602,用于获得针对所述数据库表的包含空间查询字段的查询条件;
索引获得单元603,用于获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
查询单元604,用于根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
其中,所述查询条件还包括非空间字段;所述查询单元604具体用于:
获得所述查询条件的空间字段;
判断所述空间字段是否匹配所述树型结构空间索引的索引列的空间字段标识;
如果是,则根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果;
如果否,则获取所述数据库表中匹配所述查询条件的非空间查询字段的备选记录,根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果。
其中,所述查询单元604具体用于:获得所述查询条件的非空间查询字段;
判断所述空间查询字段和所述非空间查询字段为所述数据库表的复合空间索引包括的索引列;
如果是,则确定所述查询条件符合针对所述数据库表的符合空间索引查询方式,根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询;
如果否,则根据所述查询条件从所述数据库表的复合空间索引中查询到符合所述查询条件的备选记录,根据所述备选记录的主键,回所述数据库表进一步查询得到符合所述查询条件的完整的行记录。
其中,所述查询单元604包括索引覆盖扫描子单元,所述索引覆盖扫描子单元用于:根据所述空间查询字段判断是否为查询所述数据库表的复合空间索引的空间字段;
如果是,根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询;
如果否,对数据库表的复合空间索引进行索引覆盖扫描查询。
其中,所述索引覆盖扫描子单元具体用于:获得所述空间查询字段的前缀信息包含的长度条件;
判断复合空间索引的行记录的长度是否满足所述长度条件,如果满足所述长度条件,则将所述行记录作为索引覆盖扫描查询结果;如果否,则根据主键信息对所述数据库表进行查询。
其中,所述查询单元604具体用于:
对所述备选的行记录的数据进行空间计算,根据计算结果从所述备选的行记录中获 得符合所述空间查询字段的行记录;
将所述符合所述空间查询字段的行记录作为符合所述查询条件的查询结果。
其中,所述查询条件的空间查询信息为包括空间查询字段的最小包围盒运算。
其中,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
其中,所述叶子节点还包括主键标识。
以上述实施例为基础,本申请第五实施例还提供了一种用于实现所述数据库索引的处理方法的电子设备,参照图7,其示出了第五实施例提供的一种电子设备的示意图。
本申请第五实施例描述得比较简单,相关的部分请参见上述实施例的对应说明即可。
本申请第五实施例提供一种电子设备,包括:
存储器701,以及处理器702;
所述存储器701用于存储计算机可执行指令,所述处理器702用于执行所述计算机可执行指令:
确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间字段标识的空间过滤条件;
根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
可选的,所述空间过滤条件包含空间字段前缀信息;所述处理器702还用于执行下述计算机可执行指令:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀信息;
根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引;其中,所述空间前缀索引的索引列包括所述空间字段前缀信息;
将所述空间前缀索引作为所述树型结构空间索引。
可选的,所述空间过滤条件包括最小包围盒运算类型的过滤条件;所述处理器702还用于执行下述计算机可执行指令:
根据所述最小包围盒运算类型的过滤条件,对所述数据库表进行最小包围盒过滤,得到符合所述最小包围盒运算类型的过滤条件的备选空间字段;
针对所述备选空间字段存储的空间数据进行地理空间信息标准字节流编码;
根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引。
可选的,所述空间字段前缀信息包含用于指示空间字段存储的空间数据的长度条件;所述处理器702还用于执行下述计算机可执行指令:
获得所述地理空间信息标准字节流编码后的空间数据的长度;
根据所述空间字段前缀信息获得所述长度条件;
如果地理空间信息标准字节流编码后的空间数据的长度符合所述长度条件,则在所述空间前缀索引的叶子节点存储符合长度条件的空间数据;
否则,所述空间前缀索引的叶子节点不保存所述空间数据。
可选的,所述处理器702还用于执行下述计算机可执行指令:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段的信息和所述非空间字段的信息,生成所述数据库表的复合空间索引;其中,所述空间复合索引的索引列包括所述空间字段以及所述非空间字段;
将所述复合空间索引作为所述树型结构空间索引。
可选的,所述处理器702还用于执行下述计算机可执行指令:
根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀的信息;
获得用于生成所述树型结构空间索引的非空间字段的信息;
根据所述空间字段前缀的信息和所述非空间字段的信息,生成复合前缀空间索引;其中,所述复合前缀空间索引的索引列包括所述空间字段前缀以及所述非空间字段;
将所述空间复合前缀索引作为所述树型结构空间索引。
可选的,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
可选的,所述处理器702还用于执行下述计算机可执行指令:
根据数据库表创建命令创建所述数据库表,在所述数据库表创建命令中包括生成所述树型结构空间索引的索引创建命令;或者,
根据索引创建命令创建所述树型结构空间索引。
以上述实施例为基础,本申请第六实施例还提供了一种用于实现所述数据库查询的处理方法的电子设备,其结构类似图7。
本申请第六实施例描述得比较简单,相关的部分请参见上述实施例的对应说明即可。
本申请第六实施例提供一种电子设备,包括:
存储器,以及处理器;
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间查询字段的查询条件;
获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
可选的,所述叶子节点还包括主键标识。
可选的,所述查询条件还包括非空间字段;所述处理器还用于执行下述计算机可执行指令:
获得所述查询条件的空间字段;
判断所述空间字段是否匹配所述树型结构空间索引的索引列的空间字段标识;
如果是,则根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果;
如果否,则获取所述数据库表中匹配所述查询条件的非空间查询字段的备选记录,根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果。
可选的,所述处理器还用于执行下述计算机可执行指令:
获得所述查询条件的非空间查询字段;
判断所述空间查询字段和所述非空间查询字段为所述数据库表的复合空间索引包括的索引列;
如果是,则确定所述查询条件符合针对所述数据库表的符合空间索引查询方式,根 据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询;
如果否,则根据所述查询条件从所述数据库表的复合空间索引中查询到符合所述查询条件的备选记录,根据所述备选记录的主键,回所述数据库表进一步查询得到符合所述查询条件的完整的行记录。
可选的,所述处理器还用于执行下述计算机可执行指令:
根据所述空间查询字段判断是否为查询所述数据库表的复合空间索引的空间字段;
如果是,根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询;
如果否,对数据库表的复合空间索引进行索引覆盖扫描查询。
可选的,所述处理器还用于执行下述计算机可执行指令:
获得所述空间查询字段的前缀信息包含的长度条件;
判断复合空间索引的行记录的长度是否满足所述长度条件,如果满足所述长度条件,则将所述行记录作为索引覆盖扫描查询结果;
如果否,则根据主键信息对所述数据库表进行查询。
可选的,所述处理器还用于执行下述计算机可执行指令:
对所述备选的行记录的数据进行空间计算,根据计算结果从所述备选的行记录中获得符合所述空间查询字段的行记录;
将所述符合所述空间查询字段的行记录作为符合所述查询条件的查询结果。
可选的,所述查询条件的空间查询信息为包括空间查询字段的最小包围盒运算。
可选的,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
本申请第七实施例还提供一种存储设备,其描述得比较简单,相关的部分请参见上述实施例的对应说明即可。
本申请提供一种存储设备,存储有指令,所述指令能够被处理器加载并执行以下步骤:
确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间字段标识的空间过滤条件;
根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
本申请第八实施例还提供一种存储设备,其描述得比较简单,相关的部分请参见上述实施例的对应说明即可。
本申请提供一种存储设备,存储有指令,所述指令能够被处理器加载并执行以下步骤:
所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
获得针对所述数据库表的包含空间查询字段的查询条件;
获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。

Claims (22)

  1. 一种数据库索引的处理方法,其特征在于,包括:
    确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    获得针对所述数据库表的包含空间字段标识的空间过滤条件;
    根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
  2. 根据权利要求1所述的方法,其特征在于,所述空间过滤条件包含空间字段前缀信息;
    所述根据所述空间过滤条件,生成所述数据库表的树型结构空间索引,包括:
    根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀信息;
    根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引;其中,所述空间前缀索引的索引列包括所述空间字段前缀信息;
    将所述空间前缀索引作为所述树型结构空间索引。
  3. 根据权利要求2所述的方法,其特征在于,所述空间过滤条件包括最小包围盒运算类型的过滤条件;
    所述根据所述空间字段前缀信息,生成所述数据库表的空间前缀索引,包括:
    根据所述最小包围盒运算类型的过滤条件,对所述数据库表进行最小包围盒过滤,得到符合所述最小包围盒运算类型的过滤条件的备选空间字段;
    针对所述备选空间字段存储的空间数据进行地理空间信息标准字节流编码;
    根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引。
  4. 根据权利要求3所述的方法,其特征在于,所述空间字段前缀信息包含用于指示空间字段存储的空间数据的长度条件;
    所述根据地理空间信息标准字节流编码后的空间数据和所述空间字段前缀信息,生成所述数据库表的空间前缀索引,包括:
    获得所述地理空间信息标准字节流编码后的空间数据的长度;
    根据所述空间字段前缀信息获得所述长度条件;
    如果地理空间信息标准字节流编码后的空间数据的长度符合所述长度条件,则在所 述空间前缀索引的叶子节点存储符合长度条件的空间数据;
    否则,所述空间前缀索引的叶子节点不保存所述空间数据。
  5. 根据权利要求1所述的方法,其特征在于,所述根据所述空间过滤条件,生成所述数据库表的树型结构空间索引,包括:
    根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段的信息;
    获得用于生成所述树型结构空间索引的非空间字段的信息;
    根据所述空间字段的信息和所述非空间字段的信息,生成所述数据库表的复合空间索引;其中,所述空间复合索引的索引列包括所述空间字段以及所述非空间字段;
    将所述复合空间索引作为所述树型结构空间索引。
  6. 根据权利要求1所述的方法,其特征在于,所述根据所述空间过滤条件,生成所述数据库表的树型结构空间索引,包括:
    根据所述空间过滤条件,获得用于生成所述树型结构空间索引的空间字段前缀的信息;
    获得用于生成所述树型结构空间索引的非空间字段的信息;
    根据所述空间字段前缀的信息和所述非空间字段的信息,生成复合前缀空间索引;其中,所述复合前缀空间索引的索引列包括所述空间字段前缀以及所述非空间字段;
    将所述空间复合前缀索引作为所述树型结构空间索引。
  7. 根据权利要求1所述的方法,其特征在于,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
  8. 根据权利要求1所述的方法,其特征在于,还包括:
    根据数据库表创建命令创建所述数据库表,在所述数据库表创建命令中包括生成所述树型结构空间索引的索引创建命令;或者,
    根据索引创建命令创建所述树型结构空间索引。
  9. 一种数据库查询的处理方法,其特征在于,包括:
    确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    获得针对所述数据库表的包含空间查询字段的查询条件;
    获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
    根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
  10. 根据权利要求9所述的方法,其特征在于,所述查询条件还包括非空间字段;
    所述根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果,包括:
    获得所述查询条件的空间字段;
    判断所述空间字段是否匹配所述树型结构空间索引的索引列的空间字段标识;
    如果是,则根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果;
    如果否,则获取所述数据库表中匹配所述查询条件的非空间查询字段的备选记录,根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述查询条件的空间查询字段,对所述数据库表的复合空间索引进行查询,得到符合所述查询条件的查询结果,包括:
    获得所述查询条件的非空间查询字段;
    判断所述空间查询字段和所述非空间查询字段为所述数据库表的复合空间索引包括的索引列;
    如果是,则确定所述查询条件符合针对所述数据库表的符合空间索引查询方式,根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询;
    如果否,则根据所述查询条件从所述数据库表的复合空间索引中查询到符合所述查询条件的备选记录,根据所述备选记录的主键,回所述数据库表进一步查询得到符合所述查询条件的完整的行记录。
  12. 根据权利要求11所述的方法,其特征在于,所述根据所述查询条件对所述数据库表的复合空间索引进行索引覆盖扫描查询,包括:
    根据所述空间查询字段判断是否为查询所述数据库表的复合空间索引的空间字段;
    如果是,根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询;
    如果否,对数据库表的复合空间索引进行索引覆盖扫描查询。
  13. 根据权利要求12所述的方法,其特征在于,所述根据所述空间查询字段的前缀信息包含的长度条件,对复合空间索引进行索引覆盖扫描查询,包括:
    获得所述空间查询字段的前缀信息包含的长度条件;
    判断复合空间索引的行记录的长度是否满足所述长度条件,如果满足所述长度条件,则将所述行记录作为索引覆盖扫描查询结果;
    如果否,则根据主键信息对所述数据库表进行查询。
  14. 根据权利要求10所述的方法,其特征在于,所述根据所述查询条件的空间查询字段,从所述备选记录中获得符合所述查询条件的查询结果,包括:
    对所述备选的行记录的数据进行空间计算,根据计算结果从所述备选的行记录中获得符合所述空间查询字段的行记录;
    将所述符合所述空间查询字段的行记录作为符合所述查询条件的查询结果。
  15. 根据权利要求9所述的方法,其特征在于,所述查询条件的空间查询信息为包括空间查询字段的最小包围盒运算。
  16. 根据权利要求9所述的方法,其特征在于,所述树型结构空间索引的索引列包括空间字段;所述树型结构空间索引的非叶子节点存储有用于检索所述空间数据的最小包围盒以及寻找下一层页面的页面标识。
  17. 一种数据库索引的处理装置,其特征在于,包括:
    数据库表确定单元,用于确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    过滤条件获得单元,用于获得针对所述数据库表的包含空间字段标识的空间过滤条件;
    索引生成单元,用于根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
  18. 一种数据库查询的处理装置,其特征在于,包括:
    数据库表确定单元,用于确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    查询条件确定单元,用于获得针对所述数据库表的包含空间查询字段的查询条件;
    索引获得单元,用于获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
    查询单元,用于根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
  19. 一种电子设备,其特征在于,包括:
    存储器,以及处理器;
    所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
    确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    获得针对所述数据库表的包含空间字段标识的空间过滤条件;
    根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
  20. 一种电子设备,其特征在于,包括:
    存储器,以及处理器;
    所述存储器用于存储计算机可执行指令,所述处理器用于执行所述计算机可执行指令:
    确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    获得针对所述数据库表的包含空间查询字段的查询条件;
    获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
    根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
  21. 一种存储设备,其特征在于,存储有指令,所述指令能够被处理器加载并执行以下步骤:
    确定待创建数据库索引的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    获得针对所述数据库表的包含空间字段标识的空间过滤条件;
    根据所述空间过滤条件,生成所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有符合所述空间过滤条件的空间数据以及主键标识。
  22. 一种存储设备,其特征在于,存储有指令,所述指令能够被处理器加载并执行以下步骤:
    确定待查询空间数据的数据库表;其中,所述数据库表包含用于存储空间数据的空间字段;
    获得针对所述数据库表的包含空间查询字段的查询条件;
    获得所述数据库表的树型结构空间索引;其中,所述树型结构空间索引的叶子节点存储有空间数据;
    根据所述查询条件,对所述树型结构空间索引进行查询,得到查询结果。
PCT/CN2019/119394 2018-11-27 2019-11-19 数据库索引以及数据库查询的处理方法、装置及设备 WO2020108345A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP19889311.7A EP3889797A4 (en) 2018-11-27 2019-11-19 DATABASE INDEX AND DATABASE QUERY PROCESSING METHOD, APPARATUS AND DEVICE
JP2021529833A JP2022510184A (ja) 2018-11-27 2019-11-19 データベースインデックスおよびデータベースクエリ処理方法、装置、およびデバイス
US17/332,724 US20210286795A1 (en) 2018-11-27 2021-05-27 Database index and database query processing method, apparatus, and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811422523.XA CN111221813B (zh) 2018-11-27 2018-11-27 数据库索引以及数据库查询的处理方法、装置及设备
CN201811422523.X 2018-11-27

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/332,724 Continuation US20210286795A1 (en) 2018-11-27 2021-05-27 Database index and database query processing method, apparatus, and device

Publications (1)

Publication Number Publication Date
WO2020108345A1 true WO2020108345A1 (zh) 2020-06-04

Family

ID=70827421

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/119394 WO2020108345A1 (zh) 2018-11-27 2019-11-19 数据库索引以及数据库查询的处理方法、装置及设备

Country Status (5)

Country Link
US (1) US20210286795A1 (zh)
EP (1) EP3889797A4 (zh)
JP (1) JP2022510184A (zh)
CN (1) CN111221813B (zh)
WO (1) WO2020108345A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328629A (zh) * 2020-09-14 2021-02-05 咪咕文化科技有限公司 实体对象处理方法、装置和电子设备
WO2023220973A1 (zh) * 2022-05-18 2023-11-23 京东方科技集团股份有限公司 数据处理方法、装置、电子设备和计算机可读存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641681B (zh) * 2021-10-13 2022-02-22 南京大数据集团有限公司 一种空间自适应的海量数据查询方法
CN117555906B (zh) * 2024-01-12 2024-04-05 腾讯科技(深圳)有限公司 数据处理方法、装置、电子设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391502A (zh) * 2016-05-16 2017-11-24 阿里巴巴集团控股有限公司 时间间隔的数据查询方法、装置及索引构建方法、装置
CN108628969A (zh) * 2018-04-24 2018-10-09 咪咕文化科技有限公司 一种空间关键字索引方法及平台、存储介质

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070233720A1 (en) * 2006-04-04 2007-10-04 Inha-Industry Partnership Institute Lazy bulk insertion method for moving object indexing
US8243081B2 (en) * 2006-08-22 2012-08-14 International Business Machines Corporation Methods and systems for partitioning a spatial index
US7737974B2 (en) * 2006-09-27 2010-06-15 International Business Machines Corporation Reallocation of spatial index traversal between processing elements in response to changes in ray tracing graphics workload
US8155880B2 (en) * 2008-05-09 2012-04-10 Locomatix Inc. Location tracking optimizations
US20100114905A1 (en) * 2008-11-03 2010-05-06 Elvin Slavik Method, System, and Product for Managing Spatial Data in a Database
WO2012082859A1 (en) * 2010-12-14 2012-06-21 The Regents Of The University Of California High efficiency prefix search algorithm supporting interactive, fuzzy search on geographical structured data
KR101440475B1 (ko) * 2012-10-17 2014-09-17 주식회사 리얼타임테크 혼합 질의 처리를 위한 색인 생성 방법, 혼합 질의 처리 방법 및 색인 자료구조를 기록한 기록 매체
US9104770B2 (en) * 2013-02-28 2015-08-11 Oracle International Corporation Methods for query processing of topological relationships among complex spatial objects
US10007677B1 (en) * 2014-12-04 2018-06-26 Google Llc System and method for geospatial indexing
US11210279B2 (en) * 2016-04-15 2021-12-28 Apple Inc. Distributed offline indexing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391502A (zh) * 2016-05-16 2017-11-24 阿里巴巴集团控股有限公司 时间间隔的数据查询方法、装置及索引构建方法、装置
CN108628969A (zh) * 2018-04-24 2018-10-09 咪咕文化科技有限公司 一种空间关键字索引方法及平台、存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3889797A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328629A (zh) * 2020-09-14 2021-02-05 咪咕文化科技有限公司 实体对象处理方法、装置和电子设备
WO2023220973A1 (zh) * 2022-05-18 2023-11-23 京东方科技集团股份有限公司 数据处理方法、装置、电子设备和计算机可读存储介质

Also Published As

Publication number Publication date
EP3889797A1 (en) 2021-10-06
EP3889797A4 (en) 2022-08-17
CN111221813A (zh) 2020-06-02
US20210286795A1 (en) 2021-09-16
JP2022510184A (ja) 2022-01-26
CN111221813B (zh) 2023-06-23

Similar Documents

Publication Publication Date Title
WO2020108345A1 (zh) 数据库索引以及数据库查询的处理方法、装置及设备
CN107038207B (zh) 一种数据查询方法、数据处理方法及装置
KR102157925B1 (ko) 데이터 질의 방법 및 장치
US8862566B2 (en) Systems and methods for intelligent parallel searching
Lee et al. Efficient spatial query processing for big data
CN106202207A (zh) 一种基于HBase‑ORM的索引及检索系统
JP2014002519A (ja) 時空間データ管理システム、時空間データ管理方法、及びそのプログラム
JP2009199151A (ja) k最近傍検索方法、k最近傍検索プログラム及びk最近傍検索装置
JP5075653B2 (ja) データベース管理方法、データベース管理装置、データベース管理プログラム、及び、データベースシステム
CN110555035A (zh) 一种对查询语句进行优化的方法、装置
CN114625732A (zh) 基于结构化查询语言sql的查询方法和系统
Pandey et al. How good are modern spatial libraries?
Zhang et al. High-performance online spatial and temporal aggregations on multi-core cpus and many-core gpus
CN106997354B (zh) 一种poi数据检索方法及装置
CN114297204A (zh) 一种异构数据源的数据存储、检索方法及装置
CN111680030A (zh) 数据融合方法及装置,基于元信息的数据处理方法和装置
CN116414935A (zh) 一种基于Elastic Search的分布式搜索空间矢量数据的方法
CN103902693A (zh) 一种读优化的内存数据库t树索引结构的方法
CN111125216A (zh) 数据导入Phoenix的方法及装置
CN111008198A (zh) 业务数据获取方法、装置、存储介质、电子设备
WO2023123287A1 (zh) 分子数据存储方法及装置、应用方法及装置
CN102360370A (zh) 数据集中管理系统及方法
CN114490651A (zh) 数据存储方法及装置
CN108241624A (zh) 一种查询脚本的生成方法及装置
CN111460325A (zh) Poi搜索方法、装置与设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19889311

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021529833

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019889311

Country of ref document: EP

Effective date: 20210628