Use EXPLAIN to determine what indexes are chosen in the different cases.
AFAIK, version 4 will allow you to specify HINTs in the query, so you may be
able to force the query to use certain indexes.

There are a lot of factors that affect the execution and speed of queries,
including (but not limited to) the database design, indexes defined, query
design, how much of the database can be kept in memory (cached), how much
other processing takes place on the same server, the speed of the
processor(s) and disk subsystem, etc.  Different database engines use
different algorithms for their query optimization, and different
servers/OS'es are good at different things.

>From previous posts on this list, I have heard that MySQL performs better on
Linux than it does under Windows.

Beyond this, you are not providing any useful information for determining
whether there is anything that can be improved in your query or database
design.  Since we have no idea what "speed" or "country" means in terms of
your database (what tables are they in, how large are those tables, are the
columns indexed, what is the selectivity of those indexes), what indexes are
used by your different queries, the exact nature of those queries, etc.,
anything else would be guesswork.

HTH,
Tore.

----- Original Message -----
From: "Ferhat BINGOL" <[EMAIL PROTECTED]>
To: "mysql" <[EMAIL PROTECTED]>
Sent: Saturday, February 22, 2003 4:55 PM
Subject: Re: big table, slow queries...???


> Tore,
>
> Yes, it is necasarry to pick up all the values from 5 tables. I made
indexes
> for each table. My queries are between 12 to 26 seconds now. I am
generating
> a WHERE statement before make the query. If the user do not enter the some
> min and max values I am skipping this WHERE statements.
>
> The interesting thing is (for me) when I enter lots of limits for lots of
> input values query is faster. When I just select a country for example the
> query is slower.
>
> I mean lets say that "speed" field is between 10 and 40 and I want to
chose
> a "country".
>
> if I enter 10 and 40 for range and chose country it takes 12 seconds but
if
> I do not enter speed range (as you see to enter or not is getting the same
> result) and choose a country it is 18 seconds.
>
> The main reason I asked this to the group is the same query was faster on
> interbase server. Than a question come to my mind
>
> is interbase server is faster in such huge queries? if so WHY? Cause on
> MySQL the simple queries are faster.
>
> As I said I am using MySQL 3.23 PHP Apache on WinXP. Does it help if I
> upgrade to MySQL 4.0 or is this come from XP... I am just trying to figure
> out if it is (much much) better to use Linux?
>
>
> TIA
>
>
> ---------------------------------------------------------------------
> 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
>


---------------------------------------------------------------------
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