foo

Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • in reply to: Bug for pager #86590
    foo
    Participant

    No it does not, but please see my edited post.

    I'll provide a working example soon as I've finalized it. :)

    EDIT: What I am saying is that whilst you are getting i.e. 10 records back, the SQL engine has to actually consider rows * page records in order to provide you with these 10 records.

    Unless you say “give me 10 records back fullfilling my order by criteria, starting from a row which fullfills the criteria for the first row in the page that I have found and stored to help optimize this query”.

    Also when I say “table” I mean a recordset returned to the application-server, which it can use to query the database, if the filter and (multicolumn) order hasn't changed.

    in reply to: Bug for pager #86587
    foo
    Participant

    Yes, your solution fetches all rows to the application-server, then paginates them there before sending the records to the client.

    I'm talking about fetching only the n records from page m, from the database-server, as quickly from page 1 as from page 10 million.

    I'll explain better what I mean later. :)

    EDIT: I had a look at it, and although MySQL has a LIMIT-clause, there is nothing which indicates to me that it doesn't scan the rows.

    As described here: http://www.mysqlperformanceblog.com/2006/09/01/order-by-limit-performance-optimization/

    “Also note – number of records scanned to provide result set will be very dynamic based on particular constant and other factors.
    For example for our dating example if we use only (last_online) index and look for people from USA we likely will find 10 people pretty quickly, if the country is small or simply there are few members from the country, ie Slovenia – same kind of search might need to scan 1000s times more rows to provide result set.”

    My work-around is to create a table holding the order-fields-for-first-row-in-each-page, and use that together with indexes.

    Indexes do not alone provide an optimal solution in the case of pagination.

    in reply to: Bug for pager #86576
    foo
    Participant

    Well that was a laugh and a half.

    To do actual

    in reply to: Bug for pager #86575
    foo
    Participant

    You are correct.

    The “PAGE” returned from the server, needs to be adjusted to:

    total = npages
    , page = (npages >= arguments.page ? arguments.page : npages)

    Also the query on the server needs to be adjusted, to either pick rows in the range of the page and rows requested, or the number of rows requested.

    I'll have to think abit on how to make the rows queried for, actually line up with the pages for the requested number of rows per page, whilst keeping the query as optimal as possible.

    Thanks for your help.

Viewing 4 replies - 1 through 4 (of 4 total)

Stay connected with us in your favorite flavor!