Chinese Kongfu - 9cbs.com-WellCMS
  •  Home
  •  Tech
  •  Login
6miu盘搜
  1. Tech
  2. Efficient paging mechanism

Efficient paging mechanism

xiaoxiao2021-03-06  58

After inserting a new record to the database, after the message is released, the data is immediately paised once, obtain the first ID number of each page, such as 1134, 1100, 1080, 1033, and store these ID Enter the database or a text file, in the information browsing page, pass these IDs, such as

first page

List each page: Sybase_Query ("SET ROWCOUNT 20"); Sybase_Query ("SELECT ID, TIM Test Where ID <$ ID ORDER BY ID DESC");

Haha, it is done, the number of people who send information is far less than the number of browsing information (of course for this forum), so this can greatly reduce the server's load, do not have to retrieve the entire table every time, for Sybase, MySQL, Orcal, this method should be very effective, because MySQL's LIMIT is also to retrieve the entire table.

转载请注明原文地址:https://www.9cbs.com/read-57420.html

9cbs

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.034, SQL: 10