List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 11 1999 6:47pm
Subject:Re: [PHP3] optimising a query
View as plain text  
At 11:34 AM +0100 7/11/1999, Adam Powell wrote:
>Hi there... I was just wondering about the database processing overhead in
>each of the following situations.  Basically I have a database of banners
>(for an ad rotation script) that I want to SELECT from.  The load on the
>database server got to high when I selected from ALL of them, so I split
>them up into 4 sections and in 4 individual scripts did :
>SELECT * FROM banners WHERE section=1
>SELECT * FROM banners WHERE section=2
>SELECT * FROM banners WHERE section=3
>SELECT * FROM banners WHERE section=4
>This helped get the load back down again.  However now I have come to a
>point where I have to actually revert back to my old method as there are a
>few more things I wish to do, targeting functions that must include the
>whole range of banners.
>Could anybody give me some pointers, and some tips in table design that will
>speed up SELECT * FROM banners.... are there any column types to avoid?  We
>need to do about 200 lookups a second, and there are 160 rows in the

If you want specific optimizations, you'll need to show the WHERE clause
of your query.  From the queries you show above, it looks like you're
selecting a lot more rows that you need to, for example.  You're not
really selecting a fourth of the rows (section = 1, 2, 3, or 4) for each
query just to display banner ads, are you?

Paul DuBois, paul@stripped
Northern League Chronicles:
optimising a queryAdam Powell11 Jul
  • Re: [PHP3] optimising a queryPaul DuBois11 Jul
    • Re: [PHP3] optimising a queryAdam Powell11 Jul
      • Re: [PHP3] optimising a queryAriel11 Jul
    • Re: [PHP3] optimising a querySasha Pachev12 Jul
    • Re: [PHP3] optimising a queryAdam Powell12 Jul
    • Re: [PHP3] optimising a querySasha Pachev12 Jul
  • Re: optimising a querySasha Pachev12 Jul