Skip to main content

Table.Buffer

Αποθηκεύει προσωρινά έναν πίνακα στη μνήμη, απομονώνοντάς τον από εξωτερικές αλλαγές κατά τη διάρκεια της αξιολόγησης.

Syntax

Table.Buffer(
table as table,
optional options as record
) as table

Remarks

Buffers a table in memory, isolating it from external changes during evaluation. Buffering is shallow. It forces the evaluation of any scalar cell values, but leaves non-scalar values (records, lists, tables, and so on) as-is.

  • table: The table to buffer in memory.
  • options: (Optional) The following options record values can be used:
    • BufferMode: The buffer mode that describes the type of buffering to be performed. This option can be either BufferMode.Eager or BufferMode.Delayed.

Using this function might or might not make your queries run faster. In some cases, it can make your queries run more slowly due to the added cost of reading all the data and storing it in memory, as well as the fact that buffering prevents downstream folding. If the data doesn't need to be buffered but you just want to prevent downstream folding, use Table.StopFolding instead.

Examples

Example #1

Φορτώστε όλες τις σειρές ενός πίνακα SQL στη μνήμη, έτσι ώστε τυχόν μεταγενέστερες λειτουργίες να μην μπορούν πλέον να υποβάλουν ερωτήματα στον διακομιστή SQL.

let
Source = Sql.Database("SomeSQLServer", "MyDb"),
MyTable = Source{[Item="MyTable"]}[Data],
BufferMyTable = Table.Buffer(MyTable)
in
BufferMyTable

Result:

table

Category

Table.Other