cancel
Showing results for 
Search instead for 
Did you mean: 

table scan search strategy with few records

Former Member
0 Kudos

Hello, i am testing my selects and joins with explains but the database tables have very few records now (only that i am inserting from the application to test it) and many times i see how "table scan" is selected where i am using conditions that only involve primary keys or indexed columns, can be this because of with so few records it is better to do a table scan? i should identify problems in my sql statements before put the app in production. Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

Hi (again) Soraya,

you already nailed it.

MaxDB uses a cost-based optimizer approach.

So what counts is: how many pages are expected to be read to answer a specific query?

So if there are only a few records stored in a few pages, than index access would be the worse choice.

Therefore: performance testing should always be done on the same data, same system, same load etc. than the production system.

If possible, build up a QA system (like there's ususally one in SAP landscapes), that is just a copy of the production system.

Install your changed code there and check how the statements work.

If your happy with it - get some people (or agents if you've got a test software) to perform some business processes.

KR Lars