If non-empty, the name of an index on
[table][google.spanner.v1.ReadRequest.table]. This index is used instead of
the table primary key when interpreting
[key_set][google.spanner.v1.ReadRequest.key_set] and sorting result rows.
See [key_set][google.spanner.v1.ReadRequest.key_set] for further
information.
Required. key_set identifies the rows to be yielded. key_set names the
primary keys of the rows in [table][google.spanner.v1.ReadRequest.table] to
be yielded, unless [index][google.spanner.v1.ReadRequest.index] is present.
If [index][google.spanner.v1.ReadRequest.index] is present, then
[key_set][google.spanner.v1.ReadRequest.key_set] instead names index keys
in [index][google.spanner.v1.ReadRequest.index].
If the [partition_token][google.spanner.v1.ReadRequest.partition_token]
field is empty, rows are yielded in table primary key order (if
[index][google.spanner.v1.ReadRequest.index] is empty) or index key order
(if [index][google.spanner.v1.ReadRequest.index] is non-empty). If the
[partition_token][google.spanner.v1.ReadRequest.partition_token] field is
not empty, rows will be yielded in an unspecified order.
It is not an error for the key_set to name rows that do not
exist in the database. Read yields nothing for nonexistent rows.
If greater than zero, only the first limit rows are yielded. If limit
is zero, the default is no limit. A limit cannot be specified if
partition_token is set.
public ReadRequest.Types.OrderBy OrderBy { get; set; }
Optional. Order for the returned rows.
By default, Spanner will return result rows in primary key order except for
PartitionRead requests. For applications that do not require rows to be
returned in primary key (ORDER_BY_PRIMARY_KEY) order, setting
ORDER_BY_NO_ORDER option allows Spanner to optimize row retrieval,
resulting in lower latencies in certain cases (e.g. bulk point lookups).
If present, results will be restricted to the specified partition
previously created using PartitionRead(). There must be an exact
match for the values of fields common to this message and the
PartitionReadRequest message used to create this partition_token.
If this request is resuming a previously interrupted read,
resume_token should be copied from the last
[PartialResultSet][google.spanner.v1.PartialResultSet] yielded before the
interruption. Doing this enables the new read to resume where the last read
left off. The rest of the request parameters must exactly match the request
that yielded this token.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eReadRequest\u003c/code\u003e class in the Google Cloud Spanner v1 API is \u003ccode\u003e5.0.0-beta05\u003c/code\u003e, which is accessible at the provided link.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReadRequest\u003c/code\u003e class facilitates both \u003ccode\u003eRead\u003c/code\u003e and \u003ccode\u003eStreamingRead\u003c/code\u003e operations within the Google Cloud Spanner v1 API, used to read data from a database.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides several properties for specifying the details of the read operation, including the columns to return, the table to read from, the keys to identify the rows, transaction information and more.\u003c/p\u003e\n"],["\u003cp\u003eThis class also comes with constructors and inherited members, such as \u003ccode\u003eGetHashCode()\u003c/code\u003e, \u003ccode\u003eGetType()\u003c/code\u003e, and \u003ccode\u003eToString()\u003c/code\u003e, that provide the typical class features.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eReadRequest\u003c/code\u003e class is part of the \u003ccode\u003eGoogle.Cloud.Spanner.V1\u003c/code\u003e namespace, found in the \u003ccode\u003eGoogle.Cloud.Spanner.V1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"]]],[],null,["# Google Cloud Spanner v1 API - Class ReadRequest (5.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.1.0 (latest)](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReadRequest)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/5.0.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.6.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.5.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.4.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.3.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.3.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.2.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.2.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.1.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.1.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [4.0.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/4.0.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.15.1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.15.1/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.14.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.14.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.13.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.13.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.12.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.12.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.11.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.11.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.10.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.10.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.9.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.9.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.8.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.8.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.7.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.7.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.6.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.6.0/Google.Cloud.Spanner.V1.ReadRequest)\n- [3.5.0](/dotnet/docs/reference/Google.Cloud.Spanner.V1/3.5.0/Google.Cloud.Spanner.V1.ReadRequest) \n\n public sealed class ReadRequest : IMessage\u003cReadRequest\u003e, IEquatable\u003cReadRequest\u003e, IDeepCloneable\u003cReadRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Google Cloud Spanner v1 API class ReadRequest.\n\nThe request for \\[Read\\]\\[google.spanner.v1.Spanner.Read\\] and\n\\[StreamingRead\\]\\[google.spanner.v1.Spanner.StreamingRead\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ReadRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ReadRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReadRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ReadRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReadRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ReadRequest](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReadRequest), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Spanner.V1](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Spanner.V1.dll\n\nConstructors\n------------\n\n### ReadRequest()\n\n public ReadRequest()\n\n### ReadRequest(ReadRequest)\n\n public ReadRequest(ReadRequest other)\n\nProperties\n----------\n\n### Columns\n\n public RepeatedField\u003cstring\u003e Columns { get; }\n\nRequired. The columns of \\[table\\]\\[google.spanner.v1.ReadRequest.table\\] to be\nreturned for each row matching this request.\n\n### DataBoostEnabled\n\n public bool DataBoostEnabled { get; set; }\n\nIf this is for a partitioned read and this field is set to `true`, the\nrequest is executed with Spanner Data Boost independent compute resources.\n\nIf the field is set to `true` but the request does not set\n`partition_token`, the API returns an `INVALID_ARGUMENT` error.\n\n### DirectedReadOptions\n\n public DirectedReadOptions DirectedReadOptions { get; set; }\n\nDirected read options for this request.\n\n### Index\n\n public string Index { get; set; }\n\nIf non-empty, the name of an index on\n\\[table\\]\\[google.spanner.v1.ReadRequest.table\\]. This index is used instead of\nthe table primary key when interpreting\n\\[key_set\\]\\[google.spanner.v1.ReadRequest.key_set\\] and sorting result rows.\nSee \\[key_set\\]\\[google.spanner.v1.ReadRequest.key_set\\] for further\ninformation.\n\n### KeySet\n\n public KeySet KeySet { get; set; }\n\nRequired. `key_set` identifies the rows to be yielded. `key_set` names the\nprimary keys of the rows in \\[table\\]\\[google.spanner.v1.ReadRequest.table\\] to\nbe yielded, unless \\[index\\]\\[google.spanner.v1.ReadRequest.index\\] is present.\nIf \\[index\\]\\[google.spanner.v1.ReadRequest.index\\] is present, then\n\\[key_set\\]\\[google.spanner.v1.ReadRequest.key_set\\] instead names index keys\nin \\[index\\]\\[google.spanner.v1.ReadRequest.index\\].\n\nIf the \\[partition_token\\]\\[google.spanner.v1.ReadRequest.partition_token\\]\nfield is empty, rows are yielded in table primary key order (if\n\\[index\\]\\[google.spanner.v1.ReadRequest.index\\] is empty) or index key order\n(if \\[index\\]\\[google.spanner.v1.ReadRequest.index\\] is non-empty). If the\n\\[partition_token\\]\\[google.spanner.v1.ReadRequest.partition_token\\] field is\nnot empty, rows will be yielded in an unspecified order.\n\nIt is not an error for the `key_set` to name rows that do not\nexist in the database. Read yields nothing for nonexistent rows.\n\n### Limit\n\n public long Limit { get; set; }\n\nIf greater than zero, only the first `limit` rows are yielded. If `limit`\nis zero, the default is no limit. A limit cannot be specified if\n`partition_token` is set.\n\n### LockHint\n\n public ReadRequest.Types.LockHint LockHint { get; set; }\n\nOptional. Lock Hint for the request, it can only be used with read-write\ntransactions.\n\n### OrderBy\n\n public ReadRequest.Types.OrderBy OrderBy { get; set; }\n\nOptional. Order for the returned rows.\n\nBy default, Spanner will return result rows in primary key order except for\nPartitionRead requests. For applications that do not require rows to be\nreturned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting\n`ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,\nresulting in lower latencies in certain cases (e.g. bulk point lookups).\n\n### PartitionToken\n\n public ByteString PartitionToken { get; set; }\n\nIf present, results will be restricted to the specified partition\npreviously created using PartitionRead(). There must be an exact\nmatch for the values of fields common to this message and the\nPartitionReadRequest message used to create this partition_token.\n\n### RequestOptions\n\n public RequestOptions RequestOptions { get; set; }\n\nCommon options for this request.\n\n### ResumeToken\n\n public ByteString ResumeToken { get; set; }\n\nIf this request is resuming a previously interrupted read,\n`resume_token` should be copied from the last\n\\[PartialResultSet\\]\\[google.spanner.v1.PartialResultSet\\] yielded before the\ninterruption. Doing this enables the new read to resume where the last read\nleft off. The rest of the request parameters must exactly match the request\nthat yielded this token.\n\n### Session\n\n public string Session { get; set; }\n\nRequired. The session in which the read should be performed.\n\n### SessionAsSessionName\n\n public SessionName SessionAsSessionName { get; set; }\n\n[SessionName](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.SessionName)-typed view over the [Session](/dotnet/docs/reference/Google.Cloud.Spanner.V1/latest/Google.Cloud.Spanner.V1.ReadRequest#Google_Cloud_Spanner_V1_ReadRequest_Session) resource name property.\n\n### Table\n\n public string Table { get; set; }\n\nRequired. The name of the table in the database to be read.\n\n### Transaction\n\n public TransactionSelector Transaction { get; set; }\n\nThe transaction to use. If none is provided, the default is a\ntemporary read-only transaction with strong concurrency."]]