Changes in dimension table column indexes generation.

- Indexes for dimension table columns are generated only if there
  are more than one non-PK columns.
pull/1/head
Abhinav Sarkar 2016-01-07 02:39:46 +05:30
parent 6ce2d56252
commit 089ce59f20
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ dimensionTableDefnSQL table@Table {..} = do
tablePKColName = head [ cName | PrimaryKey cName <- tableConstraints ]
nonPKColNames = [ cName | Column cName _ _ <- tableColumns, cName /= tablePKColName ]
indexSQLs = [ "CREATE INDEX ON " <> tabName <> " (" <> cName <> ")"
| cName <- nonPKColNames ]
| cName <- nonPKColNames, length nonPKColNames > 1 ]
(++ indexSQLs) <$> tableDefnSQL table
factTableDefnSQL :: Fact -> Table -> Reader Env [Text]