Subject | Re: Bad query optimisation on the MAC? |
---|---|
Author | phil_hhn |
Post date | 2004-11-27T05:12:11Z |
--- In firebird-support@yahoogroups.com, Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
today, and the MACs are running faster! But still much slower than
windows.
From Windows, connecting to Firebird running on Windows:
Running the query: 640ms.
Iterating through ALL results: 16ms (negligible)
From Windows, connecting to Firebird running on MAC:
Running the query: 3141ms first time, ~2095ms thereafter.
Iterating through ALL results: 15ms (negligible)
From Windows, connecting to Firebird running on another MAC
(supposedly faster), I think with firebird 1.5.0:
Running the query: 2313ms
Iterating through ALL results: 16ms
in the final code we will need to search on magic%, %magic, or %magic%
(the last one is probably all we'll use).
described are executed via java.sql.Statement object, calling
executeQuery and processing the returned ResultSet.
settings are the default (since we haven't changed them). If you are
talking of the physical memory on both machines, then that is
something completely different and like comparing apples and oranges.
<svein.erling.tysvaer@k...> wrote:
>picked
> Hi Phil, I'm answering simply because no-one else seems to have
> it up...to
>
> Are you sure that 0.6 seconds versus 5 seconds is the time it takes
> transfer all records to the client and not just the first few sothat
> the screen gets filled (i.e. do you read to end-of-file)?Wouldn't you know it - I decide to programatically get you the speeds
today, and the MACs are running faster! But still much slower than
windows.
From Windows, connecting to Firebird running on Windows:
Running the query: 640ms.
Iterating through ALL results: 16ms (negligible)
From Windows, connecting to Firebird running on MAC:
Running the query: 3141ms first time, ~2095ms thereafter.
Iterating through ALL results: 15ms (negligible)
From Windows, connecting to Firebird running on another MAC
(supposedly faster), I think with firebird 1.5.0:
Running the query: 2313ms
Iterating through ALL results: 16ms
> Do you get the same performance if you change from LIKE to STARTING?I've never used STARTING - is that a standard SQL keyword? Regardless,
in the final code we will need to search on magic%, %magic, or %magic%
(the last one is probably all we'll use).
> Or, moreI do not understand your question - you mean in Java? If so, the tests
> basic, exactly how are you selecting the records (which
> program/components)???
described are executed via java.sql.Statement object, calling
executeQuery and processing the returned ResultSet.
> Does Windows and Mac have the same memoryYou mean available to Firebird? Both on windows and the MAC the
> available?
settings are the default (since we haven't changed them). If you are
talking of the physical memory on both machines, then that is
something completely different and like comparing apples and oranges.
> > Then this afternoon I found something else weird.all
> >
> > I replaced "select a.title from TableA..." with "select * from
> > TableA..." and the query only takes 1.5 - 2.0 seconds!! That's a
> > huge improvement, but it doesn't make sense. How could selecting
> > columns from a table be faster than just selecting one of them?No, the same number of records are read in each instance.
>
> I suppose this could make sense if the 5 seconds were the time
> neccessary to transfer all records, whereas the 2 seconds were only
> the first few records...
> I'm sorry to say that I know nothing about MACs. In Windows, Iwould
> recommend you to run IB_SQL and read the plan, but I know nothingtime
> about neither MAC nor isql (which I expect to be able to produce a
> plan). In general LIKE does not use an index, whereas STARTING does
> (the exception being LIKE <constant>, where the optimizer at the
> of prepare can see that the first few characters of the string isThanks, will look into whether STARTING is useful to us.
> known and as such can benefit from using an index).