百度智能云

All Product Document

          Relational Database Service

          FAQs About Performance

          How to select a datasheet storage engine?

          We recommend that you use the InnoDB table for InnoDB outperforms MyISAM in case of concurrent read/write. What's more, InnoDB supports transactions, and its table is resistant to damage.

          How to set InnoDB primary key?

          Recommend you to add an "Auto Increment" primary key. The progressive increase conforms to InnoDB's data storage principle, benefits sequential data storage and reading, and helps avoid the data paging during the insertion.

          What are the suggestions for index building?

          If the index is not redundant, you cannot build too many indexes. More indexes mean lower insertion performance and larger disk usage space. We recommend that you control the number of indexes within seven, and the number of indexes should not exceed the number of fields, particularly in a variety of randomly combined indices.

          What are the suggestions for table building?

          • As to field and table, you are advised to add "COMMENT", for it benefits other colleagues in joint development or taking over the development. COMMENT for building table and field is a natural feature instruction.
          • The field is set as non-NULL, which benefits the statement query and avoids some frequent problems. InnoDB's disposal to NULL differs from its disposal to other normal data or empty data.
          • For field types, you need to mind the following points:

            • We recommend that you do not use "ENUM,SET:" for it does not benefit expansion, but leads to the write blocking by the table upon expansion and change of table structure.
            • Preferred VARCHAR length: UTF8 of no more than 2600 characters and GBK of no more than 4000 characters. Length of no more than 7,000 characters is recommended in services.
            • We recommend that you do not use large fields like BLOB and TEXT, mostly because a large field brings more IO and network outlays.
          Previous
          Performance Test Whitepaper
          Next
          FAQs About Operations