RTree as index structure in mysql?
-
Hi all, Need help on deciding Index for my database table. so here are the details. I have a table Source which have 10 million records and growing. Now the web application has search functionality. the user on web application can search for sources by name. this is a new feature which is getting implemented. Now i am using mysql 5.5. while reading there manual. I read they have implemented RTree as there data structure (BTrees are still there). SO i want to add index. Now my question is if i am adding an index name: 1. ALTER TABLE sources ADD INDEX NAMES USING BTREE (NAMES(5)); 2. ALTER TABLE sources ADD INDEX NAMES USING RTREE (NAMES(5)); What will my best bet using BTREE index or RTREE index.
-
Answer:
The purpose of an R-tree index is primarily for indexing multi-dimensional data like points and regions. I don't think an R-tree index is applicable in the usage you show, of indexing a "name" column, which I assume is just a string. mysql> ALTER TABLE sources ADD INDEX NAMES USING RTREE (NAMES(5)); ERROR 1210 (HY000): Incorrect arguments to RTREE INDEX MySQL supports R-Tree indexes only for SPATIAL indexes on geometric data types, and only in the MyISAM storage engine. For more information see https://dev.mysql.com/doc/refman/5.5/en/optimizing-spatial-analysis.html in the manual. Also see http://dev.mysql.com/doc/refman/5.5/en/create-index.html, which says: The parser recognizes RTREE as a type name, but currently this cannot be specified for any storage engine.
Bill Karwin at Quora Visit the source
Related Q & A:
- What is this structure called?Best solution by Programmers
- What is a good way to structure mark-up generating code and avoid the example mess?Best solution by Code Review
- How would I structure database the best?Best solution by Stack Overflow
- What's the proper structure of an HTML5 page that briefly lists other articles?Best solution by Webmasters
- How to Convert a C++ Structure into C# Structure?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.