SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Who does the work : PHP or mysql ?

    This is just an example, I'm more interested in the more general aspect of mysql operations.
    e.g, you have birthdate and you wanna find age.

    Ok, since mysql has the capacity to do various math,numerical,string,date operations, I was just wondering, since I dont have a sound knowledge of mysql performance, when it comes to those types of operations which one is faster:

    Get the values from mysql and then let deal with it in php coding
    or
    make more complex SELECT statements to let mysql do the work and then just pull the results from the required column/table.

    Any inputs?
    asT.

  2. #2
    SitePoint Member
    Join Date
    Feb 2003
    Location
    Laguna Niguel, Ca
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I spend a lot of time with speed issues for both PHP and mysql. In this case there are to many variables to answer the question. Here is as good as I can get for you

    If the table has a lot of records and the result set would be small then I would let Mysql do it.

    If the table has a lot of records by the result set was large I would let PHP do it

    Basiclly the above says PHP faster in processing then Mysql is in delivering the result set.

    If the table is small then time and processing will be about the same BUT I would let PHP do it as it appears to be easier on the processor overhead.

    Dennis

  3. #3
    As the name suggests... trickie's Avatar
    Join Date
    Jul 2002
    Location
    Melbourne, Australia
    Posts
    678
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I thought one of Mysql's strengths was optimization for fast searching....

    I would have thought that the db (which is an optimized application for storing and retrieving relational data) would have been truly quckier on really large result sets?

    maybe i dunno.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •