Skip to content

Commit

Permalink
Merge pull request #1433 from lillo42/improve-postgres-extensions-docs
Browse files Browse the repository at this point in the history
Improve docs on PostgreSQL Extensions
  • Loading branch information
jzabroski committed Mar 8, 2021
2 parents 1680e1f + 60918f5 commit 9c87d69
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,24 @@

namespace FluentMigrator.Builder.Create.Index
{
/// <summary>
/// The buffering options
/// </summary>
public enum GistBuffering
{
/// <summary>
/// It is initially disabled, but turned on on-the-fly.
/// </summary>
Auto,

/// <summary>
/// Enabled buffering
/// </summary>
On,
Off,
Auto

/// <summary>
/// Disabled buffering
/// </summary>
Off
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ public interface ICreateGiSTIndexOptionsSyntax : ICreateIndexMethodOptionsSyntax
new ICreateGiSTIndexOptionsSyntax Fillfactor(int fillfactor);

/// <summary>
/// Building large GiST indexes by simply inserting all the tuples tends to be slow, because if the index tuples are scattered across the index and the index is large enough to not fit in cache, the insertions need to perform a lot of random I/O.
/// Building large GiST indexes by simply inserting all the tuples tends to be slow, because if the index
/// tuples are scattered across the index and the index is large enough to not fit in cache, the insertions need
/// to perform a lot of random I/O.
/// For more information about it see: https://www.postgresql.org/docs/current/gist-implementation.html#GIST-BUFFERING-BUILD
/// </summary>
/// <param name="buffering">The buffering value.</param>
/// <param name="buffering">The <see cref="GistBuffering"/> value.</param>
/// <returns>The next step</returns>
ICreateGiSTIndexOptionsSyntax Buffering(GistBuffering buffering);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static partial class PostgresExtensions

/// <summary>
/// The constraint expression for a partial index.
/// For more information about partial index see: https://www.postgresql.org/docs/current/indexes-partial.html
/// </summary>
/// <param name="expression"></param>
/// <param name="filter">The constraint expression</param>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace FluentMigrator.Postgres
{
public static partial class PostgresExtensions
{

/// <summary>
/// The fillfactor for an index is a percentage that determines how full the index method will try to pack index pages.
/// </summary>
Expand All @@ -44,38 +43,5 @@ public static ICreateBTreeIndexOptionsSyntax Fillfactor(this ICreateIndexOptions
return expression.UsingBTree()
.Fillfactor(fillfactor) as ICreateBTreeIndexOptionsSyntax;
}

#region BRIN
public const string IndexPagesPerRange = "PostgresBrinPagesPerRange";

/// <summary>
/// Exclusive for BRIN index. Defines the number of table blocks that make up one block range for each entry of a BRIN index.
/// For more information about it see: https://www.postgresql.org/docs/current/brin-intro.html
/// </summary>
/// <param name="expression"></param>
/// <param name="range">The page per range</param>
/// <returns>The next step</returns>
public static ICreateIndexOptionsSyntax PagesPerRange(this ICreateIndexOptionsSyntax expression, int range)
{
var additionalFeatures = expression as ISupportAdditionalFeatures;
additionalFeatures.SetAdditionalFeature(IndexPagesPerRange, range);
return expression;
}

public const string IndexAutosummarize = "PostgresBrinautosummarize";

/// <summary>
/// Exclusive for BRIN index. Defines whether a summarization run is invoked for the previous page range whenever an insertion is detected on the next one.
/// </summary>
/// <param name="expression"></param>
/// <param name="autosummarize">True to enable fast autosummarize or false to disable.</param>
/// <returns>The next step</returns>
public static ICreateIndexOptionsSyntax Autosummarize(this ICreateIndexOptionsSyntax expression, bool autosummarize)
{
var additionalFeatures = expression as ISupportAdditionalFeatures;
additionalFeatures.SetAdditionalFeature(IndexAutosummarize, autosummarize);
return expression;
}
#endregion
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public static partial class PostgresExtensions
public const string IndexFastUpdate = "PostgresGinFastUpdate";
public const string IndexGinPendingListLimit = "PostgresGinPendingListLimit";
public const string IndexBuffering = "PostgresGiSTBuffering";
public const string IndexPagesPerRange = "PostgresBrinPagesPerRange";
public const string IndexAutosummarize = "PostgresBrinautosummarize";

/// <summary>
/// Column identity generation ability for PostgreSQL 10 and above
Expand Down

0 comments on commit 9c87d69

Please sign in to comment.