Sql query or apache file read?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jaap de Bergen

    Sql query or apache file read?

    Hello people,

    I'm optimizing my script because my server is under heavy load in the
    evening.

    I have a question which methode is more efficient for my server:

    =============== ===
    //connection with database is already open because other queries where
    executed first.

    $sql="select * from category where siteid=?" // category table
    contains about 1000 records, only 10 are returned

    //loop with php code through resultset and print the name and id's of
    category
    =============== ===

    or

    =============== ===
    <script src="cat.js"></script>

    cat.js contains javascript document.write( ) instruction to write 10
    categories.
    =============== ===

    In simple words: which is more efficient, a sql query with php or a
    file read done by apache?

    Thanks ;)
    Jaap
  • Chung Leong

    #2
    Re: Sql query or apache file read?

    "Jaap de Bergen" <DEBERGEN.COM@R EMOVE_THIS_TO_E MAILdomainsbypr oxy.com >
    wrote in message news:2bsp90p28p 4fan96hre4qjsc7 l0v9imtia@4ax.c om...[color=blue]
    > In simple words: which is more efficient, a sql query with php or a
    > file read done by apache?[/color]

    A static file served by Apache is always faster.


    Comment

    • Jaap de Bergen

      #3
      Re: Sql query or apache file read?

      On Sun, 9 May 2004 22:14:52 -0400, "Chung Leong"
      <chernyshevsky@ hotmail.com> wrote:
      [color=blue]
      >"Jaap de Bergen" <DEBERGEN.COM@R EMOVE_THIS_TO_E MAILdomainsbypr oxy.com >
      >wrote in message news:2bsp90p28p 4fan96hre4qjsc7 l0v9imtia@4ax.c om...[color=green]
      >> In simple words: which is more efficient, a sql query with php or a
      >> file read done by apache?[/color]
      >
      >A static file served by Apache is always faster.
      >[/color]

      That's good news. Thanks for the reply Chung!


      Comment

      Working...