Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 272853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T00:21:58+00:00 2026-05-12T00:21:58+00:00

I’ve started to use mysql_data_seek () as an easy way to roll pagination transparently

  • 0

I’ve started to use mysql_data_seek () as an easy way to roll pagination transparently into my database class by shifting the pointer and reading the current ‘page’.

What are the performance implications of doing this? I am only reading the data I need into PHP itself, but in most cases the SELECT covers the whole table – is this bad, and will I hit problems with massive tables?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T00:21:58+00:00Added an answer on May 12, 2026 at 12:21 am

    If I understand your idea you select all records in the table, then skip the first n*page records with mysql_data_seek() in order to “get to” the current page and read n records. If you have a lot of records you might not want to do that because http://php.net/mysql_data_seek says:

    Note: The function mysql_data_seek() can be used in conjunction only with mysql_query(), not with mysql_unbuffered_query()

    The difference between mysql_query() and the unbuffered version is that mysql_query() returns only after the whole result set has been copied from the MySQL server to the PHP process’ memory while after the unbuffered version each mysql_fetch_xyz() has to receive the next record from the server. If you have a lot of records and you have to transfer all of them for each single request that sounds a bit suboptimal.
    I guess you want to do this to get the total amount of records and the current subset with only one query. With MySQL you can have both, a LIMIT clause and the total number of records (that would be in the result set without the LIMIT clause),

    SELECT SQL_CALC_FOUND_ROWS id FROM foo
    ORDER BY id LIMIT 20,10

    see http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.