If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > clustered index scan in sybase

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-10, 03:08
pkb pkb is offline
Registered User
 
Join Date: Sep 2010
Posts: 10
clustered index scan in sybase

hi,

I am presently working on Sybase ASE 15.5 64 bits engine
my operating system is windows vista 64 bit.

I have loaded the database of nearly 100 GB on sybase.

the optimization goal is set to the allrows_dss.

I have a problem that the optimizer is always using the table scan it never uses the clustered index scan.

I have checked all the statistics ,indexes are present in my database. also the indexes are clustered.

even if the i run the query.

select count(*) from A
where A.b <= 10


{where A is a very large table containing more than 200million rows.}

in the above query hardly 1% of totals rows comes as output, Sybase does table scan for it. I have checked for many queries Sybase never used the clustered index scan. while the same queries I used with MS-SQL where it always used clustered index scan.

I didn't understand what the problem is why sybase is not using the clustered index scan with even very low selectivity.

Is there some configuration changes have to make to allow sybase also use index scan.

please provide me the solution of this problem.

thank you.
Reply With Quote
  #2 (permalink)  
Old 12-14-10, 07:03
JanSaveTran JanSaveTran is offline
Registered User
 
Join Date: Dec 2010
Posts: 2
1.

First take a look if the db-table is fragmented or not :
Use function derived_stat for this to determine if your index/data is fragmented or not.

select derived_stat("<table_name>", "<clus_indexname>", "dpcr")
Value between 0 and 1. Nearby 1 not fragmented. Near 0 then fragmented.
If fragmented then do rebuild the index. ( drop and then create ).
Beware, lots of, takes time and resources to rebuild a clustered index having a table that 'big'.

2. Force the index to be used...

select count(*)
from A ( index <indexname> )
where b <= 10

Better to not use index-forcing.. This I personnally find a very cheap method.

For more methods and for further reading about these methods I will ask
you to read the Sybase ASE performance and tuning manuals which are available at the Sybase website(s)

gr,

Jan
Reply With Quote
  #3 (permalink)  
Old 12-14-10, 14:12
mike_bike_kite mike_bike_kite is offline
vaguely human
 
Join Date: Jun 2007
Location: London
Posts: 2,519
can you supply the create index statements?
and preferably the create table statement?
Mike
__________________
Mike
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On