The index is an important feature of database system, whether it is a traditional relational database or a fashionable NoSQL database, it is of great concern to query performance, so it needs to be considered carefully when designing database. However, the bottom of Lotus Notes hiding technology, the user interface-oriented, the pursuit of the concept of rapid development, so that "index" few developers mention, or even understand. People only talk about views, and when different people say "view" in different situations, the meaning is different. For ordinary users, if you use the word view, it refers to a list of lines of information that is displayed, and the view in the developer's mouth is a type of design element in the database. This design element, in Lotus Notes style, blends the design of the view layer with the definition of the data layer, such as the font, color, and width of the column, which includes selecting documents, extracting fields and calculating column contents, defining sorting, sorting, totals, and so on. If you consider only the database part of notes, the data definition of the latter is the topic.
Notes applications tend to be slow after being used for a period of time, that is, when the database becomes larger and users become more numerous. One important factor is the view, which opens the application, creates a new modified document, and executes the agent, possibly opening the view either clearly or implicitly. These times, it is the index hiding behind the view that affects performance.
In the technology mix used in mainstream development, the database is a separate piece, and the developer needs to design and define the data with a different knowledge of the language in which the business logic is written, so the database administrator who specializes in this is derived. In Lotus Notes applications, the development of databases, business logic, and user interfaces is tightly coupled, while in large companies there are people dedicated to maintaining servers, deploying and updating databases, but they generally do not check the design of the database to optimize performance. The performance of a database is the mightily of a program developer, and in fact, without an experienced programmer, the application is slower than many users can tolerate, and performance is rarely considered when developed by a Notes programmer. Database slowness is only attributed to too many documents, too large attachments, and the Notes database. Many older programmers have developed applications in which the same type of documentation is just for the sake of sorting the order of the different 10 of views, each view 10 more than 20 columns, six or seven column classification, the other almost all set the sort. Once the number of documents increases, this design will seriously affect performance, and in the eyes of the designer, just for the convenience of users and is a proof of notes convenience. This view design and its functional abuse, of course, is not the responsibility of the programmer, guide them to do so in the development of notes, help documents are not the blame.
With such a long opening, it's time to discuss the index and its relationship to application performance. The function of the index in the relational database is summed up as a comparison of the index of the notes view. Simply put, an index is a mapping of some useful information from data to the location of the information in a large amount of data in order to quickly query. In front of the dictionary pinyin and Radicals gept table is the index, more image of the example is a lot of foreign books at the end of the index attached, you can find important words appear in the page number. The number of records in the database is huge, and in practice there is a need to find records that meet a variety of conditions. For example, a table that records 1 million people's information, including name, birthday, gender, address, phone number, and so on. To find out the surname Zhao or the phone number is 26538941 people, if there is no special help, the database system can only check the record line by row, the average number of records to find a record is N/2 (n is the total number of records). If you extract the phone number field from the record, sort it, and each number points to the position of the corresponding record in the table, an index is built. At this point, to query the phone number is 26538941 people, simply apply a binary query algorithm to the index, the workload will be reduced to log2 (N) level, plus the index row from the location to determine and read the original data row of the operation. In addition, because each row of the index is much shorter than each of the original records, the single read itself is faster. The negative impact of the index is space and maintenance costs. It's good to understand that the indexed data itself takes up space. When the original record is updated (new, modified, and deleted), the index will naturally be updated as well. An update to an index can be selected at the same time as the original record, timed, or used in the index, which is the query, but in any case, additional calculations are required compared to no indexes. When you add a record, updating the index is purely a performance overhead. When modifying and deleting, there are selection criteria except for all records, at which point the index is in the same help as the query, and updating the index after modification and deletion is an overhead, because the benefits of the former are greater, so the combined effect is generally performance-positive (unless the number of records is small or the number of indexes is too high).
The Notes view index is discussed in detail in the Notes database from view index (bottom).
83. From the view index said Notes database (top)