#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    1
    Rep Power
    0
    I am constructing a shopping cart and when i do a query for price ranges it SLOWS everything down.. my other queries run fine
    i search WHERE PRICE > LowPrice AND PRICE < High Price and it slows things down.

    Would indexing the prices help?
    Between statements?
    Any thoughts ..

    Thanks in Advance
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    18
    YES! ALWAYS index any field you're planning to do use in a where, group by, order by clause.

    And yes, using BETWEEN will work faster as well.

Similar Threads

  1. search DB by date range
    By Simm in forum PHP Development
    Replies: 1
    Last Post: February 4th, 2004, 01:35 PM
  2. Is there any alternative to fulltext search?
    By irishairpics in forum MySQL Help
    Replies: 2
    Last Post: December 10th, 2003, 02:40 PM
  3. Replies: 3
    Last Post: August 6th, 2002, 10:49 AM
  4. advanced search with relevance using php and mysql
    By Patrick M in forum PHP Development
    Replies: 11
    Last Post: February 8th, 2002, 05:42 AM
  5. perform a search over a range of dates
    By oach in forum MySQL Help
    Replies: 7
    Last Post: November 2nd, 2001, 03:15 PM

IMN logo majestic logo threadwatch logo seochat tools logo