cancel
Showing results for 
Search instead for 
Did you mean: 

Sample 10 PERCENT Question

Former Member
0 Kudos

Hello Everybody

I want do do an:

"Update table xyz SAMPLE 10 PERCENT "

for my big tables.

Do i have to fire this command for each wanted table or does an:

"update table set sample_rows = .NULL.,sample_percent = 10 where ..."

lead to the same result.

Best regards

Albert

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Sorry

Of course it has to be:

Alter table xyz sample 10 PERCENT

lbreddemann
Active Contributor
0 Kudos

Hi Albert,

basically the sample size has to be changed seperately for each table.

But if you want to e.g. set the sample size for all tables with more than 1000000 entries you can generate a script like this:


select 'ALTER TABLE ' || t.tablename || ' SAMPLE 10 PERCENT //'
from files f, tables t 
where 
    f.type ='TABLE' 
and f.entrycount >=1000000
and f.fileid = t.tableid

The result of this will be a script that you can run directly.

KR Lars

lbreddemann
Active Contributor
0 Kudos

HI Albert,

the script-solution needs a little bit of manual work to get the generated script to work (add linebreaks before the
).

If you want to avoid it, you may want to check .

KR Lars

Answers (0)