OnDemand User Group

Support Forums => Report Indexing => Topic started by: jsquizz on August 12, 2022, 08:48:36 AM

Title: Best Practice - Index vs Filter
Post by: jsquizz on August 12, 2022, 08:48:36 AM
It's been a long time since I've done report development, but Im trying to come up with some standards. Also, I am not a DBA by any stretch of the imagination

Wondering about AG fields - Here are my below assumptions I'd assume are correct.

1) Is there any reason why I would not always use an index as field type?
2) Referring to question 1 - Would I only use an index on fields that are searched commonly, AKA - Account, SSN, Name, ETC.
3) Dates- Should they be filters?
4) "Dropdown Boxes" - should they be filters?

Wondering how everyone does it and if i can get some tips. In the mean time, I'll be hitting up mr google. Thanks
Title: Re: Best Practice - Index vs Filter
Post by: Justin Derrick on August 15, 2022, 11:27:43 AM
1)  Storage space.  Indexes take up a lot of space.
2)  Only the MOST UNIQUE ("high cardinality") fields like customer number or policy number.
3)  Usually.
4)  Probably.

Indexes in the CMOD database work the same was as the index in the back of a book.  Indexing the words 'the' 'and' & 'a' are pointless, because it's not particularly meaningful or useful - you only put words in the index that help you find what you're looking for.

I've had a few questions about this lately.  I'll write something up.

-JD.
Title: Re: Best Practice - Index vs Filter
Post by: jsquizz on August 16, 2022, 02:31:41 PM

Space isn't so much a concern I dont think but who knows.

thank you for this!
Title: Re: Best Practice - Index vs Filter
Post by: Justin Derrick on August 17, 2022, 10:44:37 AM
Space is always a concern - if not now, in the not-too-distant future.  :)

-JD.
Title: Re: Best Practice - Index vs Filter
Post by: Steve Bechtolt on November 02, 2022, 11:48:09 AM
You really need to think about query performance. 
If there are no indexes, then the queries have to scan every row in the database table, which can take a really long time on high-volume data.
Having indexes on fields such as cust_num, subscriber_number, etc. and making them required will improve performance dramatically.