Skip to content

Commit

Permalink
Limit translation of PCTFREE into FILLFACTOR when PCTFREE is upper th…
Browse files Browse the repository at this point in the history
…an the Oracle default value: 10. With PostgreSQL 100 (complete packing) is the default.
  • Loading branch information
darold committed Aug 15, 2018
1 parent e76cecb commit c699fd6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Ora2Pg.pm
Expand Up @@ -2562,7 +2562,11 @@ sub read_schema_from_file
$self->{tables}{$tb_name}{table_info}{tablespace} =~ s/"//gs;
}
if ($tb_param =~ /PCTFREE\s+(\d+)/is) {
$self->{tables}{$tb_name}{table_info}{fillfactor} = 100 - min(90, $1);
# We only take care of pctfree upper than the default
if ($1 > 10) {
# fillfactor must be >= 10
$self->{tables}{$tb_name}{table_info}{fillfactor} = 100 - min(90, $1);
}
}
if ($tb_param =~ /\bNOLOGGING\b/is) {
$self->{tables}{$tb_name}{table_info}{nologging} = 1;
Expand Down Expand Up @@ -10508,7 +10512,8 @@ sub _table_info
} else {
$tables_infos{$row->[1]}{partitioned} = 1;
}
if (($row->[7] || 0) > 0) {
# Only take care of PCTFREE upper than the Oracle default value
if (($row->[7] || 0) > 10) {
$tables_infos{$row->[1]}{fillfactor} = 100 - min(90, $row->[7]);
}
if ($do_real_row_count) {
Expand Down

0 comments on commit c699fd6

Please sign in to comment.