Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Paging Decision

Paging Decision

Scheduled Pinned Locked Moved Database
questiondatabasesysadmin
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohamad Al Husseiny
    wrote on last edited by
    #1

    As all know we use paging when we want to a void return a larg set of records over network so the question is How i know in advance if the query will return many records or not? so using paging or not. I know i can put some logic in my application to prevent the user to run query which my return many record like select all,....... but i can't know in all cases thanks in advance

    G 1 Reply Last reply
    0
    • M Mohamad Al Husseiny

      As all know we use paging when we want to a void return a larg set of records over network so the question is How i know in advance if the query will return many records or not? so using paging or not. I know i can put some logic in my application to prevent the user to run query which my return many record like select all,....... but i can't know in all cases thanks in advance

      G Offline
      G Offline
      Guillermo Rivero
      wrote on last edited by
      #2

      What comes to my mind is doing 2 querys. The first one with COUNT statement, so you'll know how many records will the query have. The second, the query that'll return the records. Paging ? If your application is Web, ASP.NET DataGrid provides Paging functions. I've used them and they worked fine, but my query never returned more than 200 records. :) Free your mind...

      M 1 Reply Last reply
      0
      • G Guillermo Rivero

        What comes to my mind is doing 2 querys. The first one with COUNT statement, so you'll know how many records will the query have. The second, the query that'll return the records. Paging ? If your application is Web, ASP.NET DataGrid provides Paging functions. I've used them and they worked fine, but my query never returned more than 200 records. :) Free your mind...

        M Offline
        M Offline
        Mohamad Al Husseiny
        wrote on last edited by
        #3

        thanks guillermo but i think that executing two query may add extra overload at the server what do you see?

        H G 2 Replies Last reply
        0
        • M Mohamad Al Husseiny

          thanks guillermo but i think that executing two query may add extra overload at the server what do you see?

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          If the server performs the query on behalf of the client, it can check first to see how many records were returned in the query (using various means) and then decide if it should return the entire result set to the client. This also gives you central administration of such a threshold.

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          1 Reply Last reply
          0
          • M Mohamad Al Husseiny

            thanks guillermo but i think that executing two query may add extra overload at the server what do you see?

            G Offline
            G Offline
            Guillermo Rivero
            wrote on last edited by
            #5

            Yes there are 2 querys, but both you can make them both work on the same procedure, so it'll be so fast. As both querys will reference the same table and use the same condition, when the second query executes, it'll be on the DB cache. Free your mind...

            M 1 Reply Last reply
            0
            • G Guillermo Rivero

              Yes there are 2 querys, but both you can make them both work on the same procedure, so it'll be so fast. As both querys will reference the same table and use the same condition, when the second query executes, it'll be on the DB cache. Free your mind...

              M Offline
              M Offline
              Mohamad Al Husseiny
              wrote on last edited by
              #6

              THANKS FOR ALL

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups