how to get massive amounts of info from the database?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lawrence

    how to get massive amounts of info from the database?

    If you're doing extensive formatting of output from a database, then
    you can't ask for all of a type of entry ("SELECT * FROM mainContent")
    and print it to the screen. On the one hand, it is an annoying thing
    to do to one's users, and on the other hand, the problem I've run
    into, with only a few hundred records you start to run into PHP's
    default 30 second time out.

    Besides paging, what are some of the strategies people are using to
    get large amounts of data from the database and to the screen?
  • lunatech

    #2
    Re: how to get massive amounts of info from the database?

    lawrence wrote:[color=blue]
    > If you're doing extensive formatting of output from a database, then
    > you can't ask for all of a type of entry ("SELECT * FROM[/color]
    mainContent")[color=blue]
    > and print it to the screen. On the one hand, it is an annoying thing
    > to do to one's users, and on the other hand, the problem I've run
    > into, with only a few hundred records you start to run into PHP's
    > default 30 second time out.[/color]

    Use limit to limit the number of records on each page .
    select * where 1 limit $startlimit,100 Paging is a good idea. DO you
    really want to display 1000 records on a single page ? Who will even
    pay attenton to that much data ?

    On a sidenote do read "The Case Against SELECT *"


    Comment

    • R. Rajesh Jeba Anbiah

      #3
      Re: how to get massive amounts of info from the database?

      lkrubner@geocit ies.com (lawrence) wrote in message news:<da7e68e8. 0411191204.1069 a4b6@posting.go ogle.com>...[color=blue]
      > If you're doing extensive formatting of output from a database, then
      > you can't ask for all of a type of entry ("SELECT * FROM mainContent")
      > and print it to the screen. On the one hand, it is an annoying thing
      > to do to one's users, and on the other hand, the problem I've run
      > into, with only a few hundred records you start to run into PHP's
      > default 30 second time out.
      >
      > Besides paging, what are some of the strategies people are using to
      > get large amounts of data from the database and to the screen?[/color]

      If PHP times out in 30 seconds, you must be pulling *huge* data.
      People won't usually pull such huge data.

      Some scaling solutions:
      1. Page caching - One time caching
      2. Query caching
      3. DB cluster
      4. Load balancers.

      --
      <?php echo 'Just another PHP saint'; ?>
      Email: rrjanbiah-at-Y!com

      Comment

      • lawrence

        #4
        Re: how to get massive amounts of info from the database?

        "lunatech" <r.shekhar@gmai l.com> wrote in message news:<110101601 7.454562.107700 @z14g2000cwz.go oglegroups.com> ...[color=blue]
        > Use limit to limit the number of records on each page .
        > select * where 1 limit $startlimit,100 Paging is a good idea. DO you
        > really want to display 1000 records on a single page ? Who will even
        > pay attenton to that much data ?
        >
        > On a sidenote do read "The Case Against SELECT *"
        > http://www.parseerror.com/sql/select*isevil.html[/color]

        Couldn't reach the site you suggest. However, I agree with the
        sentiment. My software is slow because I used SELECT * too much. I'm
        hoping to have time to do some optimization early next year, and the
        main thing I'll be looking at is fine tuning what information I'm
        asking the database for.

        Comment

        Working...