dotnet / dotnet/efcore

Datatable Load seems to take far too long to execute.

Open
#28,879 6 comments 0 reactions 0 assignees View on GitHub
area-adonet-sqlite customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

As seen in the example below, I am trying to load just the schema informat from an SQLite Table. The table contains 5 Million records and pauses for around 40 seconds on the ```C# dt.Load(dr) ``` line.

Interestingly, If I do not use LIMIT 1, the ```C# dt.Load(dr) ``` statement actually attempts to load all 5 Million rows.

```C#
Using cm As New SqliteCommand("SELECT * FROM [OneBigTable] LIMIT 1", oCn)
Using dr = cm.ExecuteReader(CommandBehavior.SchemaOnly)
dt = New DataTable
dt.Load(dr)
End Using
End Using
```

Microsoft.Data.Sqlite version: 6.0.8
Target framework: (e.g. .NET 4.8)
Operating system: Windows 10

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.