Subject | Re: Index analysis - what does mean nodes, dup and max dup? |
---|---|
Author | emb_blaster |
Post date | 2008-11-22T12:17:04Z |
> If yoursorry I misstyped. Wanna type "page size" typed "pages cache". mine
> performance is OK, then don't worry about packing density.
> ....
> Yes, we generally recommend increasing the page size (not the
> cache size!) when the depth of any index goes above 3.
mistake.
Indeed understand!
> > so average data length can be calc by expr "(nodes-totaldup)/nodes"?oh yes! now that you said I remember read this in your text.
>
> No. You get a lower average data length when you have duplicates,
> but there are other factors that compress keys....
(prefix, sufix, trailing, spaces, etc... remembered I wil read it
again to fix it in my mind ;)
>ok! that is! I´m trying to understand this edge cases, when an Index
> > in this case? an bigger average data length is a "good" index and a
> > smaller a "bad" index that can slow down query?
>
> Having a lot of duplicates makes an index more dense, so you get
> more entries on a page. That's good. Having data that compresses
> well also makes indexes dense. But you should index fields based
> on usage, not compression. If you frequently search for records
> based on values of a particular field, index it. Yes, there are
> edge cases - if the number of duplicates is so large that you're
> going to read every data page anyway, then don't bother with the
> index.
>
can be bad
and instead of help selects, only slow down inserts and updates.
> > that´s mean the first index is better than this second?so only running a query will I can say it is a bad or good index?
>
> No, indexes are good if they make queries faster, bad otherwise.
this is an more actual stats. Only viewing it I can say if is good or
bad indexes?
Index SAIDAPRODUTOS_IDX2 (2)
Depth: 3, leaf buckets: 843, nodes: 698840
Average data length: 0.01, total dup: 698609, max dup: 4158
Index SAIDAPRODUTOS_IDX3 (3)
Depth: 3, leaf buckets: 1349, nodes: 698840
Average data length: 0.01, total dup: 697202, max dup: 99598
> > Index SAIDAPRODUTOS_IDX2 (2)yes currently I´m using Firebird SS 2.0.4 and will continue using
> > Depth: 2, leaf buckets: 9, nodes: 8865
> > Average data length: 0.02, total dup: 8740, max dup: 156
> >
> > this index is in a DATE column. like you can imagine I use it in many
> > many querys. it have only 125 distincts values. one of this values is
> > repeated 156 times.
> > it this a bad index? can I drop this index?
>
> That index is probably OK. When you find more than twenty or thirty
> thousand duplicates of a single value, you should either find a way
> to make the index more selective (e.g. make it a compound index with
> the primary key as the second term) or move to Firebird V2 or greater.
> Duplicates don't matter very much for retrievals, but they really
> slow down garbage collection in older versions.
>
2.0.x new versions ´til jan/2009 while testing FB 2.1.x or a FB 2.5
stable version for upgrade. So I don´t need bother with duplicates?
even if it is hundreds of thousand?
> Best,Thank you for help again. sorry this topic is taking so long, but I
>
> Ann
>
want understand indexes things.
Best,
Elton