Posts

Planquery

Image
Cet article est une ébauche concernant une commune du Calvados. Vous pouvez partager vos connaissances en l’améliorant ( comment ? ). Le bandeau {{ébauche}} peut être enlevé et l’article évalué comme étant au stade « Bon début » quand il comporte assez de renseignements encyclopédiques concernant la commune. Si vous avez un doute, l’atelier de lecture du projet Communes de France est à votre disposition pour vous aider. Consultez également la page d’aide à la rédaction d’un article de commune. Planquery.mw-parser-output .entete.map{background-image:url("//upload.wikimedia.org/wikipedia/commons/7/7a/Picto_infobox_map.png")} Le château. Administration Pays   France Région Normandie Département Calvados Arrondissement Bayeux Canton Trévières Intercommunalité Communauté de communes Isigny-Omaha Intercom Maire Mandat Christian Declomesnil 2014-2020 Code postal 14490 Code commune 14506 Démog...

Unique filtered index and surprising estimation

Image
up vote 3 down vote favorite When I view the estimated execution plan for this query... SELECT * FROM tabela2 x LEFT JOIN dbo.tabela1 t with (nolock) on t.Kod = x.Kod ... the Estimated Number of Rows property for [table1] shows 10 . Why is this? In the schema (copied below) I have a unique index AKF_tabela1_Kod . Shouldn't this unique index force the row estimation to be 1 ? Estimated Execution Plan Create Database, Tables and Index -- create database USE [master] GO DROP DATABASE IF EXISTS my_test; CREATE DATABASE my_test; GO ALTER DATABASE my_test SET AUTO_CREATE_STATISTICS OFF; ALTER AUTHORIZATION ON DATABASE ::my_test TO sa; USE my_test GO -- create dbo.tabela1 CREATE TABLE dbo.[tabela1] ( [Id] int NOT NULL identity(1,1), [kol1] varchar(20) NOT NULL, [Kod] int NULL, ...