You are reading a single comment by @Velocio and its replies. Click here to read the full conversation.
  • I've just confirmed that running it as one query (do the search and figure out how many results there are whilst only returning the first 25) takes 1 minute and 38 seconds.

    Running it as two queries (do the search, return 25 rows and then figure out how many results there are) takes 2.5 seconds in total.

    Definitely will change this.

    Though... there is a risk that the search will be slower on subsequent pages. i.e. it may take towards 15-20 seconds (and risk timing out on some queries that return very large result sets) to fetch page 2 or more.

    In essence I had chosen to implement a way of searching in which the cost for all pages was equal, but it's probably best to tune for making page 1 very cheap, and subsequent pages expensive.

  • Would that mean that while a user is reading page 1, the subsequent pages would be being fetched and...cached for loading?...

    Sorry I'm not massively familiar with this level of coding.

About

Avatar for Velocio @Velocio started