MS SQL external table running very slow

108 Views Asked by At

I have one external table that has only 2 columns and 3 rows in it and when i run query to fetch data using external table that take almost 15 mins to get the data. I am not sure why that much slow as there is only 3 row and 2 columns in it.

This test i am running on local database using SQL Polybase service.

Approach i have followed is created Module table in main database and created external table on another database and trying to fetch from other database. I used below script to create source and external table.

CREATE LOGIN testlocal
WITH PASSWORD = 'test#!451235'

CREATE USER [testlocal] 
FOR LOGIN [testlocal] 
WITH DEFAULT_SCHEMA = dbo; 

ALTER ROLE db_datareader ADD MEMBER [testlocal]; 

CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'test#!451235';

create DATABASE SCOPED CREDENTIAL CrossDbCredLocal  
WITH IDENTITY = 'testlocal',                    
SECRET = 'test#!451235';                    
GO

CREATE EXTERNAL DATA SOURCE testlocal
WITH (
  LOCATION = 'sqlserver://localhost' ,
  CREDENTIAL = CrossDbCredLocal
);

CREATE EXTERNAL TABLE dbo.Module
(
    ID int NOT NULL,
    Name varchar(50) NOT NULL
)
WITH
(
LOCATION='ModuleIdentity.dbo.Module',
DATA_SOURCE = testlocal
);

I am missing something or did not configured properly?

0

There are 0 best solutions below