none
DB with digital cadastral map RRS feed

  • Frage

  • I have a strange behavior with my DB.

    I'm using a database with 1.800.000 lands with the dcm (Data type is geimetry - Shape format).

    I attached the exactly same database on two different SQL-Servers:

    • Microsoft SQL Server 2012 - 11.0.5582.0 (X64) Feb 27 2015 18:10:15 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
    • Microsoft SQL Server 2014 - 12.0.2548.0 (X64) Jun  8 2015 11:08:03 Copyright (c) Microsoft Corporation Standard Edition (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)

    If i execute an select it takes on the SQL-Server 2014 much longer...

    SQL-Server 2014:  64GB RAM 1600 MHz | 16 Cores, Logical processors 32 2,60 GHz | Storage is Samsung SSD 850 Pro 1TB

    SQL-Server 2012:  16GB RAM | 8 Cores 2,49GHz |

    The Querys are:

    SET STATISTICS TIME ON
    SELECT 
           shape
    FROM 
           its.DKM_GST 
    WHERE 
           DKM_GST.SHAPE.STIntersects(geometry::STPolyFromText('POLYGON((70000 352000, 70200 352000, 70200 352200, 70000 352200, 70000 352000))',31255)) = 1
    union all
    select geometry::STPolyFromText('POLYGON((70000 352000, 70200 352000, 70200 352200, 70000 352200, 70000 352000))',31255)
    SET STATISTICS TIME OFF
     
     
    
    SET STATISTICS TIME ON
    SELECT 
           shape
    FROM 
           its.DKM_GST WITH(index(SI_DKM_GST))
    WHERE 
           DKM_GST.SHAPE.Filter(geometry::STPolyFromText('POLYGON((70000 352000, 70200 352000, 70200 352200, 70000 352200, 70000 352000))',31255)) = 1
    union all
    select geometry::STPolyFromText('POLYGON((70000 352000, 70200 352000, 70200 352200, 70000 352200, 70000 352000))',31255)
    SET STATISTICS TIME OFF
    • First Select on the SQL-Server 2012: 186 ms (73 Rows)
    • Second Select on the SQL-Server 2012: 24 ms (211 Rows)
    • First Select on the SQL-Server 2014: 5332 ms (73 Rows)
    • Second Select on the SQL-Server 2014: 34 ms (211 Rows)

    Select on a local database on my computer (Spec.: 24GB RAM 1333 MHz | 2 CPU's - 12 Cores, logical processors 24 3,06 GHz | Storage is Samsung SSD 850 Pro 512GB)

    • First Select on local database: 10663 ms (73 Rows)
    • Second Select on local database: 186 ms (211 Rows)

    Why does it take longer on the SQL-Server 2014 as on the SQL-Server 2012? - The SQL-Server 2014 has more power...


    Freitag, 21. August 2015 09:21

Antworten

Alle Antworten

  • Hallo,

    dem Firmennamen nach vermute ich mal, Du sprichst auch Deutsch; den das hier ist ein DE Forum.

    Ist die Spalte indiziert und wenn ja, wird der Index auf dem SQL Server 2014 auch genutzt? Hast Du mal den Ausführungsplan auf SQL Server 2012 mit 2014 verglichen, wie sehen die aus?

    Ist die Datenbank auf 2014 im Compatibilitätsmodus 110 oder 120? Falls es 120 ist, stell das mal auf 110 um und teste die Abfrage erneut. Mit SQL Server 2014 wurde ein neuer Cardinality Estimator eingeführt, der in manchen Fällen einen schlechteren Ausführungsplan erstellt; mit Comp Mode 110 wird der alte CE verwendet.


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Freitag, 21. August 2015 09:48
  • Vergleich doch mal die Ausführungspläne. Beachte bitte auch, dass die Developer Edition im Prinzip eine Enterprise Edition ist und daher ggf. einige Sachen performanter abwickelt.

    Einen schönen Tag noch,
    Christoph
    --
    Microsoft SQL Server MVP - http://www.insidesql.org/blogs/cmu

    Freitag, 21. August 2015 12:37
  • Hallo,

    Die Spalte Shape ist mit einem Spatial Index vershen, zusätzlich gibt es noch eine ID Spalte die einen normalen Primary Key hat.

    Die Ausführungsplänen sehen vom zweiten "select" wie folgt aus:

    SQL-Server 2012

    SQL-Server 2014

    Ich habe den Kompatibilitätsmodus mal von 120 auf 110 geändert. - Die Abfragen laufen schneller...

    Montag, 16. November 2015 12:07