Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Checking indexes after large deletes

2 views
Skip to first unread message

bozon

unread,
Jun 6, 2006, 11:26:26 AM6/6/06
to
Is there a way to determine how "messed up" an index is after a large
number of deletes have been done to a table? I searched here and didn't
see anything. Is there an oncheck command or sysmaster table to look
at? If so what values should I look for? I have to make a case for
rebuilding indexes and having hard data would make my case stronger.

Thanks.

Adam Tauno Williams

unread,
Jun 6, 2006, 12:08:35 PM6/6/06
to inform...@iiug.org


I don't know if it is what you are looking for but I use these three
queries to look at index effectiveness:

Index key uniqueness:
select tabname, idxname, nrows, nunique from systables t, sysindexes i
where t.tabid = i.tabid and t.tabid > 99 and nrows > 0 and nunique >0;

Index depth:
select idxname, levels from sysindexes order by 2 desc;

How many times the engine has resorted to a sequential scan:
select tabname, sum(seqscans) tot_scans from sysmaster:sysptprof where
seqscans > 0 and dbsname not like "sys%" group by 1;

Marco Greco

unread,
Jun 6, 2006, 12:08:07 PM6/6/06
to bozon, inform...@iiug.org
> _______________________________________________
> Informix-list mailing list
> Inform...@iiug.org
> http://www.iiug.org/mailman/listinfo/informix-list
>

Why rebuild the index after you have gone through the effort of marking all
those keys as deleted? drop the index first.
Caveat: if you are using the index to drive the delete, that might not be a
good idea...

--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!

Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm

bozon

unread,
Jun 6, 2006, 1:23:02 PM6/6/06
to
Good idea to drop the index first. In general this is what I do, but
this process is part of a job that removes customer data for customers
that no longer use our product. It is part of a monthly cleanup and it
happens while the instance is on line.

So is there a way to know if the cleaner is keeping up and
restructuring the indexes (by removing the keys that are marked deleted
and then reorganizing the nodes to rebalance the B-Tree?

Art S. Kagel

unread,
Jun 6, 2006, 4:16:21 PM6/6/06
to bozon
bozon wrote:
> Good idea to drop the index first. In general this is what I do, but
> this process is part of a job that removes customer data for customers
> that no longer use our product. It is part of a monthly cleanup and it
> happens while the instance is on line.
>
> So is there a way to know if the cleaner is keeping up and
> restructuring the indexes (by removing the keys that are marked deleted
> and then reorganizing the nodes to rebalance the B-Tree?

onstat -g btc

Will show you what index pages have been marked for cleaning. If you see a
preponderence of pages for a single partnum (index or index fragment) that
would be a candidate for a rebuild if you cannot wait for the Btree Cleaners
to catch up.

Art S. Kagel

Hamilton, Jerry

unread,
Jun 6, 2006, 4:25:37 PM6/6/06
to inform...@iiug.org

"Onstat -g btc" must be a V10 feature, I don't have it available on my
V9.4 instance.

bozon

unread,
Jun 7, 2006, 8:29:27 AM6/7/06
to
I can't seem to get "onstat -g btc" to return anything in 9.21 FC4 or
10.0 FC4.

Adam Tauno Williams

unread,
Jun 7, 2006, 8:48:49 AM6/7/06
to inform...@iiug.org
> I can't seem to get "onstat -g btc" to return anything in 9.21 FC4 or
> 10.0 FC4.

It doesn't do anything on my "10.00.UC4" box.

There is "btree cleaner info", with "onstat -C". Is that the same
thing?

Doug McAllister@Fidelity Investments

unread,
Jun 7, 2006, 2:07:35 PM6/7/06
to
hmmm, btc is not a valid option in my 10.00.FC4 instance and when I try
it onstat gives me the help listing. When I try it on my 9.40
instances, I get nothing at all.

TBP

unread,
Jun 7, 2006, 2:30:50 PM6/7/06
to
Yes ...

onstat -C

Use the -C option to print the file information about the B-tree scanner
subsystem and each B-tree scanner thread. The following options are
available with the onstat -C command:

prof
Prints the profile information for the system and each B-tree
scanner thread
hot
Prints the hot list index key in the order to be cleaned
part
Prints all partitions with index statistics
clean
Prints information about all the partitions that were cleaned or
need to be cleaned.
range
Prints the savings in pages processes by using index range scanning
all
Prints all onstat -C options

Darren...@carmax.com

unread,
Jun 7, 2006, 2:58:15 PM6/7/06
to TBP, informix-l...@iiug.org, inform...@iiug.org
I recall sometime back that someone was going to generate a paper on tuning
the b-tree scanner. Anyone recall who it was? Jerry, weren't you
interested in this too?

Art, was it you by chance?

peace


TBP
<TheBigPotato@Not
Here.Co.Uk> To
Sent by: inform...@iiug.org
informix-list-bou cc
nc...@iiug.org

Subject
Re: Checking indexes after large

06/07/2006 02:30 deletes
PM




onstat -C

Hamilton, Jerry

unread,
Jun 7, 2006, 3:09:09 PM6/7/06
to inform...@iiug.org

Yes I was interested in this too.

I think a blue person came on here and said, "If you put this line in
your onconfig, all your problems with the b-tree scanner will be
forgotten". So I did and I forgot all about my b-tree scanner. But I
still don't know what the heck it's doing.

BTSCANNER num=1,priority=low,threshold=50000,rangesize=10000

-----Original Message-----
From: informix-l...@iiug.org
[mailto:informix-l...@iiug.org] On Behalf Of

Gentsch, Sam

unread,
Jun 7, 2006, 5:11:23 PM6/7/06
to Hamilton, Jerry, inform...@iiug.org

I received an interesting email concerning BTSCANNERS
from a kind man at IBM Tech support....kind of a question and answer
document.

Would I be hung and quartered for sharing it with folks that ask me?

Also Neil has some very good information on the subject...on his web
site.

--
Sam Gentsch

Neil Truby

unread,
Jun 7, 2006, 5:33:32 PM6/7/06
to
"Doug McAllister@Fidelity Investments" <doug...@gmail.com> wrote in
message news:1149703655.7...@u72g2000cwu.googlegroups.com...

> hmmm, btc is not a valid option in my 10.00.FC4 instance and when I try
> it onstat gives me the help listing. When I try it on my 9.40
> instances, I get nothing at all.

Nor on my 10.0FC5 one ...
[informix@orbistest01 ~]$ onstat -g btc

IBM Informix Dynamic Server Version 10.00.UC5 -- On-Line -- Up
04:56:48 -- 28048 Kbytes
usage: onstat [ -abcdfghklmpstuxzBCDFRX ] [ -i ] [ -r [<seconds>] ]
[ -o [<outfile>] ] [ <infile> ]
-a Print all info
-b Print buffers
-c Print configuration file
-d [update]
Print spaces and chunks
....


Hamilton, Jerry

unread,
Jun 8, 2006, 11:07:15 AM6/8/06
to Gentsch, Sam, inform...@iiug.org

Please share it.

John Miller

unread,
Jun 9, 2006, 3:09:33 AM6/9/06
to
> BTSCANNER num=1,priority=low,threshold=50000,rangesize=10000

Here is what this paramater means:

num= the number of btree scanner threads to start when the engine starts up

priority= low | high
low means run the btree scanner below a normal user thread and only
give the btree scanner extra CPU cycles
high means run the btree scanner thread equal to that of a normal users

threshold=
This is the number of times a user must encounter an index item which
has been marked for deletion, but has not been removed. Examples If you
delete 20,000 rows the delete will generate a count of 20,000 for this
index. If you then run a select that scans the index encountering 1/2
of the index items you just deleted then this will count as 10,000 for
this index. So each index item encountered when select, inserts,
updates, delete encounter an items marked for deletion in an index but
still consuming space will count as 1 hit on this index. When this
index exceed this count the index will be compressed and rebalanced.

rangesize=
Prior to 10.00.UC5 there was only two methods for cleaning an index,
leaf scanning (i.e. walking all leaf pages) and range scanning (i.e
walking a range of pages physically adjacent). The later is much, much
faster. Range scanning does a light scan on the index to read the
pages, avoiding saturating the buffer pool with unwanted index pages.
For small indexes they are already in the buffer pool so we will want to
user leaf scanning. This paramater determines the size cut off for
using the two different scanning methods.

If more detail on this topic is required I would be happy to do a talk
on this at the Information on Demand Conference in October, or a Chat
with the lab talk.

let me know.
John Miller

Darren...@carmax.com

unread,
Jun 9, 2006, 8:16:06 AM6/9/06
to John Miller, informix-l...@iiug.org, inform...@iiug.org
John,

Don't forget Lester's call for presentation for the DC User's Forum! Chat
w/Lab sounds great too.

peace


John Miller
<jmiller@jfmiii.c
om> To

Sent by: inform...@iiug.org
informix-list-bou cc
nc...@iiug.org
Subject
Re: Checking indexes after large

06/09/2006 03:09 deletes
AM

Kernoal

unread,
Jun 15, 2006, 2:15:39 PM6/15/06
to
John,

This would be a great topic for a "Chat with the lab".

Thanks

Kernoal

Neil Truby

unread,
Jun 18, 2006, 4:40:41 AM6/18/06
to
----Original Message-----
From: Gentsch, Sam [mailto:sgen...@intercall.com]
Sent: Wednesday, June 07, 2006 4:11 PM
To: Hamilton, Jerry; inform...@iiug.org
Subject: RE: Checking indexes after large deletes

>> I received an interesting email concerning BTSCANNERS from a kind man at

>> IBM Tech support....kind of a question and answer document ... Also Neil

>> has some very good information on the subject...on his web site.

http://www.informix-support.co.uk/btscanner.htm


Gentsch, Sam

unread,
Jun 20, 2006, 9:37:10 AM6/20/06
to Hamilton, Jerry, inform...@iiug.org

Paul put it up for us.
Try www.oninit.com/btscanner.html and you should get a 'pretty' version

--
Sam

>-----Original Message-----
>From: Hamilton, Jerry [mailto:hami...@fleishman.com]

>Please share it.

Neil Truby

unread,
Jun 20, 2006, 1:35:18 PM6/20/06
to
"Gentsch, Sam " <sgen...@intercall.com> wrote in message
news:mailman.335.115081041...@iiug.org...

Paul put it up for us.
Try www.oninit.com/btscanner.html and you should get a 'pretty' version

http://www.informix-support.co.uk/btscanner.htm is better!


0 new messages