Subject | Re: [ib-support] Help with extremely slow SQL |
---|---|
Author | Andrew Guts |
Post date | 2003-02-08T09:31:48Z |
nitaligavino wrote:
aggregate function.
Specify only columns you need in select statement.
try this:
select M.MKey, ...
from MediaItem I
inner join Media M on I.MKey = M.MKey
where I.IState = ?
of course.
Hope it will help
Good luck
Andrew
>Hello all:Why did you write "group by". There is no reason to use it wihout
>
>I need some help understanding how an SQL statement is executed
>within the FB engine. Specifically, I need to understand why an SQL
>statement such as:
>
>SELECT * FROM Media WHERE MKey IN (SELECT MKey FROM MediaItem WHERE
>IState = ? GROUP BY MKey)
>
>
aggregate function.
Specify only columns you need in select statement.
try this:
select M.MKey, ...
from MediaItem I
inner join Media M on I.MKey = M.MKey
where I.IState = ?
>Here is what the statistics are:I guess you should increase number of buffers. If you have enough memory
>
>Execution Time: 00:03:22:0488
>Prepare Time: 00:00:00:0010
>Starting Memory: 9200186
>Current Memory: 9221676
>Delta Memory: 21490
>Number of Buffers: 2048
>
of course.
>Obviously, I have rewritten some of my queries and found betterIt also depends of size of columns, optimal indexing, and so on.
>performance but what I need to understand is why any query,
>regardless of how complex, should take more that a few milliseconds
>to seconds when there is only 1300 rows in the db??
>
>
Hope it will help
Good luck
Andrew
>
>