Re: "Included Columns" in index definition? (MSSQL)

Andy Jerison

It's okay to define indexes for SQL databases. If you let Magic create the tables, you should set them all as virtual indexes. I'd say the best practice is to make all indexes virtual. Magic will include ORDER BY clauses on selected indexes and the database will use its optimizer to process the queries efficiently. 

Maintaining a lot of indexes imposes serious overhead on the database. Most indexes we had to create in Pervasive aren't necessary in a decent SQL database. 

You should instead use the database's tuning tools to create indexes once your db is populated.


On Sun, Dec 20, 2020, 13:42 sherman levine <sherman.levine@...> wrote:

My own answer would be that I define an index whenever I want to see a subset of records displayed in a specific sequence and I don't want to do a runtime sort.

For example, show all the records created by user XXXX in datetime sequence.

Similarly, I define an index when I want to return a specific record in a link. (show me the most recent record created by user XXXX)

Is that inappropriate?



On 12/20/2020 1:30 PM, Andy Jerison wrote:
Why are you defining an index? 

On Sun, Dec 20, 2020, 12:46 Avgerinos <mento@...> wrote:
Hi magicians :-)

When defining an Index In the Data-Repository of XPA (v.3 or 4) and
besides the "Index Key Columns",
is there any way to specify the "Included Columns" when defining an
index for an MSSQL table?

Thanks in advance

Join to automatically receive all group messages.