Skip to content

Commit 79981d1

Browse files
committed
Postgresql: Declare the same setting for nulls in indexes as in order by statement
otherwise, index order conflicts with order by which cause longer query execution. According to documentation default settings for nulls are exact opposite.
1 parent 0da23ca commit 79981d1

File tree

1 file changed

+3
-0
lines changed
  • Orm/Xtensive.Orm.PostgreSql/Sql.Drivers.PostgreSql/v9_0

1 file changed

+3
-0
lines changed

Orm/Xtensive.Orm.PostgreSql/Sql.Drivers.PostgreSql/v9_0/Translator.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public override void Translate(SqlCompilerContext context, object literalValue)
3030
}
3131
}
3232

33+
public override void TranslateSortOrder(IOutput output, bool ascending) =>
34+
output.Append(ascending ? "ASC NULLS FIRST" : "DESC NULLS LAST");
35+
3336
// Constructors
3437

3538
public Translator(SqlDriver driver)

0 commit comments

Comments
 (0)