SlideShare a Scribd company logo
Зачем мне знать SQL и Базы
Данных, ведь у меня есть ORM?
Денис Резник
Intapp, Inc.
Agenda
• .Net ORM History which I remember
• Simple Queries
• Column List
• Lazy Load
• Data Types
• Data Modification
• Complex Query
• Parameter Sniffing
ORM History which I remember
• ADO.NET
• Data Sets (not too bad)
• LLBL Gen, NHibernate (better than data sets)
• LINQ to SQL (Awesome!)
• Entity Framework should be even more awesome
• Entity Framework is more powerful than L2S
• Entity Framework Code First
• Entity Framework is no so good, so what?
Simple Query
DEMO: Simple Query
Column List
DEMO: Column List
Lazy Load
Index Seek
…
…
1 .. 1M
1 .. 2K 2K+1 .. 4K 1M-2K .. 1M
1 .. 300 301 .. 800 801 .. 1,5K 1,5K+1 .. 2K
SELECT * FROM Users
WHERE Id = 523
Index Scan
…
…
1 .. 1M
1 .. 2K 2K+1 .. 4K 1M-2K .. 1M
1 .. 300 301 .. 800 801 .. 1,5K 1,5K+1 .. 2K
SELECT * FROM Users
Index Range Scan
…
…
1 .. 1M
1 .. 2K 2K+1 .. 4K 1M-2K .. 1M
1 .. 300 301 .. 800 801 .. 1,5K 1,5K+1 .. 2K
SELECT * FROM Users
WHERE Id BETWEEN 700
AND 1700
DEMO: Lazy Load
Data Types
DEMO: Data Types
Data Modification
DEMO: Data Modification
Complex Query
DEMO: Complex Query
Parameter Sniffing
Parameter Sniffing - Stored Procedure
EXEC ReportCheckSecurityRequest
@UserId = 1
Query
Processor
SQL Server Cache
Procedure cache
Plan created and cached for the
@UserId = 1
Procedure cache
EXEC ReportCheckSecurityRequest
@UserId = 22
Query executes using the query plan created for
@UserId = 1
Parameter Sniffing – Parametrized Query
SELECT * FROM Clients WHERE Id = @Id
Query
Processor
SQL Server Cache
Procedure cache
Plan created and cached for the
@Id = 1
Procedure cache
Query executes using the query plan created for
@Id = 1
SELECT * FROM Clients WHERE Id = @Id
sp_executesql N'SELECT * FROM Clients
WHERE Id = @Id', N'@Id int', 1
sp_executesql N'SELECT * FROM Clients
WHERE Id = @Id', N'@Id int', 22
Dynamic SQL – Multiple Plans
SELECT * FROM Clients WHERE Id = 1
Query
Processor
SQL Server Cache
Procedure cache
New query plan created and cached. Query
executed using newly created plan.
Procedure cache
SELECT * FROM Clients WHERE Id = 22
New query plan again created and cached.
Query executed using newly created plan.
SELECT * FROM Clients WHERE Id = 1
Query executed using the query plan, created
for the first query.
Procedure cache
DEMO: Parameter Sniffing
Summary
• ORM is really a nice thing
• But it still requires strong SQL background
• Database internals knowledge is a skill that very
nice to have even in the ORM world
• Few Advices
• Sometimes check the generated SQL and its query plan
• For complex queries consider raw SQL anyway
• Consider using Dapper
• Invest your time to learn database internals
Thank You!
@denisreznik
denisreznik@gmail.com
http://reznik.uneta.com.ua/
https://www.facebook.com/denis.reznik.5
https://www.linkedin.com/pub/denis-reznik/3/502/234

More Related Content

PPTX
Евгений Напрягло ".NET Framework Hosting API Overview"
PPTX
Сергей Радзыняк ".NET Microservices in Real Life"
PPTX
Игорь Леонтьев "Azure Container Service: not only Docker"
PPTX
Сергей Калинец "Стероиды для Дотнетчика"
PPTX
Debugging your Way through .NET with Visual Studio 2015
PPTX
Qui Quaerit, Reperit. AWS Elasticsearch in Action
POTX
Mobile 3: Launch Like a Boss!
PDF
Building & Testing Scalable Rails Applications
Евгений Напрягло ".NET Framework Hosting API Overview"
Сергей Радзыняк ".NET Microservices in Real Life"
Игорь Леонтьев "Azure Container Service: not only Docker"
Сергей Калинец "Стероиды для Дотнетчика"
Debugging your Way through .NET with Visual Studio 2015
Qui Quaerit, Reperit. AWS Elasticsearch in Action
Mobile 3: Launch Like a Boss!
Building & Testing Scalable Rails Applications

What's hot (20)

PPTX
ASP.NET vNext
PDF
AWS to Bare Metal: Motivation, Pitfalls, and Results
PPTX
Node proxy
PDF
What's New in Nuxeo Platform 7.3
PPTX
Project meniscus
PPTX
Internals of Steroids Framework
PPTX
Tokyo azure meetup #9 azure update, october
PPTX
Debugging the Web with Fiddler
PPTX
Tokyo Azure Meetup #9 - Azure Update, september
PPTX
MVC 6 - the new unified Web programming model
PDF
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
PDF
ECS위에 Log Server 구축하기
PPTX
Windows Azure Blob Storage
PPTX
Docker y azure container service
PDF
OSMC 2014: Interesting use cases of Zabbix improvements in latest versions | ...
PDF
Breaking the Monolith - Microservice Extraction at SoundCloud
PDF
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
PPT
.NET Core Apps: Design & Development
PPTX
Microsoft ASP.NET 5 - The new kid on the block
PPTX
Azure Update, July 2016
ASP.NET vNext
AWS to Bare Metal: Motivation, Pitfalls, and Results
Node proxy
What's New in Nuxeo Platform 7.3
Project meniscus
Internals of Steroids Framework
Tokyo azure meetup #9 azure update, october
Debugging the Web with Fiddler
Tokyo Azure Meetup #9 - Azure Update, september
MVC 6 - the new unified Web programming model
https://docs.google.com/presentation/d/1DcL4zK6i3HZRDD4xTGX1VpSOwyu2xBeWLT6a_...
ECS위에 Log Server 구축하기
Windows Azure Blob Storage
Docker y azure container service
OSMC 2014: Interesting use cases of Zabbix improvements in latest versions | ...
Breaking the Monolith - Microservice Extraction at SoundCloud
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
.NET Core Apps: Design & Development
Microsoft ASP.NET 5 - The new kid on the block
Azure Update, July 2016
Ad

Similar to Денис Резник "Зачем мне знать SQL и Базы Данных, ведь у меня есть ORM?" (20)

PPTX
Dapper: the microORM that will change your life
PPT
What's New for Data?
PPTX
Orms vs Micro-ORMs
PPT
MySQL, LINQ and the ADO_NET Entity Framework Presentation.ppt
PPTX
Entity Framework v1 and v2
PPT
B_110500002
PPTX
Entity Framework Overview
PPTX
Entity Framework V1 and V2
PPTX
ORMs Meet SQL
PPTX
ORM - Ivan Marković
PPTX
Microsoft Data Access Technologies
PPT
Entity Framework Overview
PDF
seminar100326a.pdf
PPTX
What Impact Will Entity Framework Have On Architecture
PPTX
Getting started with entity framework
PPTX
Introduction to Telerik OpenAccess ORM
PPT
SQL Server 2008 Positioning
PPTX
The tortoise and the ORM
PPTX
.NET Database Toolkit
Dapper: the microORM that will change your life
What's New for Data?
Orms vs Micro-ORMs
MySQL, LINQ and the ADO_NET Entity Framework Presentation.ppt
Entity Framework v1 and v2
B_110500002
Entity Framework Overview
Entity Framework V1 and V2
ORMs Meet SQL
ORM - Ivan Marković
Microsoft Data Access Technologies
Entity Framework Overview
seminar100326a.pdf
What Impact Will Entity Framework Have On Architecture
Getting started with entity framework
Introduction to Telerik OpenAccess ORM
SQL Server 2008 Positioning
The tortoise and the ORM
.NET Database Toolkit
Ad

More from Fwdays (20)

PDF
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
PDF
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
PPTX
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
PPTX
"Як ми переписали Сільпо на Angular", Євген Русаков
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
PDF
"Validation and Observability of AI Agents", Oleksandr Denisyuk
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
PPTX
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
PPTX
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
PDF
"AI is already here. What will happen to your team (and your role) tomorrow?"...
PPTX
"Is it worth investing in AI in 2025?", Alexander Sharko
PDF
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
PDF
"Scaling in space and time with Temporal", Andriy Lupa.pdf
PDF
"Database isolation: how we deal with hundreds of direct connections to the d...
PDF
"Scaling in space and time with Temporal", Andriy Lupa .pdf
PPTX
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
PPTX
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
PPTX
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
PPTX
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...
"Mastering UI Complexity: State Machines and Reactive Patterns at Grammarly",...
"Effect, Fiber & Schema: tactical and technical characteristics of Effect.ts"...
"Computer Use Agents: From SFT to Classic RL", Maksym Shamrai
"Як ми переписали Сільпо на Angular", Євген Русаков
"AI Transformation: Directions and Challenges", Pavlo Shaternik
"Validation and Observability of AI Agents", Oleksandr Denisyuk
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
"Co-Authoring with a Machine: What I Learned from Writing a Book on Generativ...
"Human-AI Collaboration Models for Better Decisions, Faster Workflows, and Cr...
"AI is already here. What will happen to your team (and your role) tomorrow?"...
"Is it worth investing in AI in 2025?", Alexander Sharko
''Taming Explosive Growth: Building Resilience in a Hyper-Scaled Financial Pl...
"Scaling in space and time with Temporal", Andriy Lupa.pdf
"Database isolation: how we deal with hundreds of direct connections to the d...
"Scaling in space and time with Temporal", Andriy Lupa .pdf
"Provisioning via DOT-Chain: from catering to drone marketplaces", Volodymyr ...
" Observability with Elasticsearch: Best Practices for High-Load Platform", A...
"How to survive Black Friday: preparing e-commerce for a peak season", Yurii ...
"Istio Ambient Mesh in production: our way from Sidecar to Sidecar-less",Hlib...

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Heart disease approach using modified random forest and particle swarm optimi...
PDF
August Patch Tuesday
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Getting Started with Data Integration: FME Form 101
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
cloud_computing_Infrastucture_as_cloud_p
Assigned Numbers - 2025 - Bluetooth® Document
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Network Security Unit 5.pdf for BCA BBA.
Heart disease approach using modified random forest and particle swarm optimi...
August Patch Tuesday
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25-Week II
Group 1 Presentation -Planning and Decision Making .pptx
Tartificialntelligence_presentation.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Univ-Connecticut-ChatGPT-Presentaion.pdf
Encapsulation theory and applications.pdf
Getting Started with Data Integration: FME Form 101
SOPHOS-XG Firewall Administrator PPT.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cloud_computing_Infrastucture_as_cloud_p

Денис Резник "Зачем мне знать SQL и Базы Данных, ведь у меня есть ORM?"