Re: Website Run By Offsets Query

From: René (anonymous_at_nospam.info)
Date: 03/11/04


Date: Thu, 11 Mar 2004 12:33:08 +0100

Really an off topic answer, but who cares.

Mostly you would not use your method but use "LIMIT " in their SQL to show
part or only one of the records. With for instance LIMIT 29, 1 you would
have the thirtiest row. The next would be just incrementing 29 and you don't
need any function to do that. It would be just one database query to get the
next, which I suppose would be the same as retrieving through a key value.
Most likely the response will take a bit longer that way.

Another way, more complicated, is having a field in your database that
points to the next and former record. That way you would retrieve through a
(indexed) key, which should speed up things. Of course you would need to
change everything around inserting and deleting records, because these
pointers would need to be updated and you would need to decide on what
criteria you decide what is the next record, which would be something like a
fixed sort order.

On my local Mysql server the query SELECT * FROM `whatever` LIMIT 130 , 1,
to somewhere in the middle of a table took 0.0079 seconds, and LIMIT 268 , 1
is to the end of this table and takes 0.0136 seconds. This is on a Athlon
600Mhz with one user; I am sure your situation could be faster.

When I do the query on a indexed key field value then the query to the
middle of the table takes 0.0065 seconds.

Conclusion: it really depends on the size of your table. If your table is
not extremely long, I would think the method with LIMIT is sufficiently fast
and will not load your server.

René
www.comunica2.net



Relevant Pages

  • Re: New "base document" available
    ... be done about retrieving command line parameters. ... System) which was for passing messages, control, and data between the ... new forms of Query Expression which are "SQL-like" but far removed from SQL ...
    (comp.lang.cobol)
  • Re: How do the records retrieve from data base when using sql statements?
    ... file size changes significantly the query optimizer may decide to get the ... unless you have select/omit criteria in a logical that you want SQL to ... on the physical file only, ensures retrieving rows according ...
    (comp.sys.ibm.as400.misc)
  • Database query.
    ... In database query, the value of the variable is taken from excel file. ... .PreserveFormatting = True ... .RefreshStyle = xlInsertDeleteCells ...
    (microsoft.public.excel.programming)
  • Re: excel report
    ... links to excel as a database query and then feeds into specific cells the ... The database query option is found in excel under data / get external data ... In excel i have a database query populating the sheet called "Source Data" ...
    (microsoft.public.access.reports)
  • Re: excel report
    ... links to excel as a database query and then feeds into specific cells the ... The database query option is found in excel under data / get external data ... In excel i have a database query populating the sheet called "Source Data" ...
    (microsoft.public.access.gettingstarted)