Hi there,

Using MySQL 3.22.27 and php3.  The page I have does 7 queries to the database
and then displays the page.  The first time it runs it takes 9 secs or more
before the data is displayed and then after that the thread is cached on MySQL.
But when I run the same Query from MySQL console I get query times of .16 secs.
I have changed the query and use the 'limit 2' in the sql statement and it still
takes 9 or more secs if it is not a cached thread.

The SQL statement is as follows:

SELECT mlsnumber from custmls where listingoffice = 0251 and
(listingstatus = 'ACT' or listingstatus = 'A*') and
scategory = 1 limit 2

The only thing different in each query is the value of scategory.

This the first time its run takes 9 or more seconds, there is an index on
listingstatus the looks at 12000 records.  I have tried an index on listing
office,listingsstatus and scategory  to see if it speeds up the query and I get
a result of 0 , where there are 81 records matching when I did a count before
the index was created.

There are only 71685 records in the table.

I have set the following variables:

set-variable      =key_buffer=16M
set-variable      =table_cache=256
set-variable      =sort_buffer=4M
set-variable      =record_buffer=1M

I'm running on a Sun Ultra 10s 333 sparc Processor and 256mb of ram, Solaris 7
OS.

Any ideas would be great.

Thanks in advance.

Pat

Pat Militzer
Tech Support Supervisor
Metro/MLS Inc.
11430 W North Ave
Wauwatosa, WI 53226
414-778-5400 ext. 124
Fax 778-6143
email: [EMAIL PROTECTED]
web site: www.metromls.com
          www.wihomes.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to