Unix Technical Forum

Varying query performance

This is a discussion on Varying query performance within the Oracle Database forums, part of the Database Server Software category; --> Environment: Oracle 8.1.6.3.0 on Sun SPARC Solaris 8. We have a client-server application where one of the forms performs ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-23-2008, 05:24 AM
Vsevolod Afanassiev
 
Posts: n/a
Default Varying query performance

Environment: Oracle 8.1.6.3.0 on Sun SPARC Solaris 8.

We have a client-server application where one of the
forms performs full table scan on a particular table.
The table isn't very big (460,000 rows), and this full table
scan normally takes 3 - 10 seconds depending on the load on the box.
As this form is being actively used, even delay in 3 - 10
seconds is annoying to the users.

In order to speed up the operation I modified properties of this table:
CACHE=Y and BUFFER_POOL=KEEP. Note that this is the only table
in the KEEP pool, this pool has 15,000 blocks while the table
has 8500 blocks so it should fit perfectly. Indeed, the runtime
of the query went down to 0.3 second and V$SESSION_EVENT
shows neither "db file scattered read" nor "db file sequential read".

However, in my test on average every 5th run has duration
significantly longer than 0.3 second (basically back in 3 - 10 second range),
and V$SESSION_EVENT shows that most of this could be attributed
to "db file scattered read" and "db file sequential read".

So, what could cause Oracle to peform physical reads
when the table should be in memory? The table gets about 1000
inserts per day and similar number of updates.

Thanks,
Sev
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-23-2008, 05:24 AM
sybrandb@yahoo.com
 
Posts: n/a
Default Re: Varying query performance

vafanassiev@aapt.com.au (Vsevolod Afanassiev) wrote in message news:<4f7d504c.0312172252.566510aa@posting.google. com>...
> Environment: Oracle 8.1.6.3.0 on Sun SPARC Solaris 8.
>
> We have a client-server application where one of the
> forms performs full table scan on a particular table.
> The table isn't very big (460,000 rows), and this full table
> scan normally takes 3 - 10 seconds depending on the load on the box.
> As this form is being actively used, even delay in 3 - 10
> seconds is annoying to the users.
>
> In order to speed up the operation I modified properties of this table:
> CACHE=Y and BUFFER_POOL=KEEP. Note that this is the only table
> in the KEEP pool, this pool has 15,000 blocks while the table
> has 8500 blocks so it should fit perfectly. Indeed, the runtime
> of the query went down to 0.3 second and V$SESSION_EVENT
> shows neither "db file scattered read" nor "db file sequential read".
>
> However, in my test on average every 5th run has duration
> significantly longer than 0.3 second (basically back in 3 - 10 second range),
> and V$SESSION_EVENT shows that most of this could be attributed
> to "db file scattered read" and "db file sequential read".
>
> So, what could cause Oracle to peform physical reads
> when the table should be in memory? The table gets about 1000
> inserts per day and similar number of updates.
>
> Thanks,
> Sev


KEEP replaces cache. Both KEEP and CACHE do NOT guarantee the table is
never removed from the cache.
You should ask yourself why you want to perform FTS all the time on a
table of 460000 rows. A FTS ALWAYS proceed to the HWM, if the table is
volatile, you will encounter severe problems soon. I guess you are
better off rethinking and redesigning, removing the Fundamental Flaws
of the app, rather than throwing memory at the problem. Your app will
never scale if you don't address this issue.

Sybrand Bakker
Senior Oracle DBA
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-23-2008, 05:25 AM
Geomancer
 
Posts: n/a
Default Re: Varying query performance

> However, in my test on average every 5th run has duration
> significantly longer than 0.3 second (basically back in 3 - 10 second range),
> and V$SESSION_EVENT shows that most of this could be attributed
> to "db file scattered read" and "db file sequential read".
>
> So, what could cause Oracle to peform physical reads
> when the table should be in memory? The table gets about 1000
> inserts per day and similar number of updates.


Why guess?

Query v$bh and see if the blocks are in the cache.

Try this script:

http://www.dba-oracle.com/art_builder_buffer.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-23-2008, 05:25 AM
Tony
 
Posts: n/a
Default Re: Varying query performance

vafanassiev@aapt.com.au (Vsevolod Afanassiev) wrote in message news:<4f7d504c.0312172252.566510aa@posting.google. com>...
> Environment: Oracle 8.1.6.3.0 on Sun SPARC Solaris 8.
>
> We have a client-server application where one of the
> forms performs full table scan on a particular table.
> The table isn't very big (460,000 rows), and this full table
> scan normally takes 3 - 10 seconds depending on the load on the box.
> As this form is being actively used, even delay in 3 - 10
> seconds is annoying to the users.
>
> In order to speed up the operation I modified properties of this table:
> CACHE=Y and BUFFER_POOL=KEEP. Note that this is the only table
> in the KEEP pool, this pool has 15,000 blocks while the table
> has 8500 blocks so it should fit perfectly. Indeed, the runtime
> of the query went down to 0.3 second and V$SESSION_EVENT
> shows neither "db file scattered read" nor "db file sequential read".
>
> However, in my test on average every 5th run has duration
> significantly longer than 0.3 second (basically back in 3 - 10 second range),
> and V$SESSION_EVENT shows that most of this could be attributed
> to "db file scattered read" and "db file sequential read".
>
> So, what could cause Oracle to peform physical reads
> when the table should be in memory? The table gets about 1000
> inserts per day and similar number of updates.
>
> Thanks,
> Sev


I can't answer your technical question, but my initial reaction is:
WHY do you have a form that scans 460,000 rows frequently? No user
could possibly scroll through that many rows; if the users are
querying all records but then just viewing the first few, maybe a
FIRST_ROWS hint would help? Or an enforced restriction on the rows
queried?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-23-2008, 05:35 AM
srivenu
 
Posts: n/a
Default Re: Varying query performance

sev,
The number of buffers needed for the table are more than the number of
blocks in the table below HWM.
This is because the query needs CR buffers whereas INSERTS and UPDATES
need CURRENT Buffers.
You can check all these in V$BH.
Just check whether the UPDATES are being done with an INDEX scan or
FTS.
regards
Srivenu
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:36 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com