Wrong number of partition in sys.partitions query

  • Hi

    I have a DB where I never partitioned a table and I have no partition function.

    I execute the query:

    select * from sys.partitions where object_id = object_id('MySchema.MyTable')

    and i get:

    partition_id object_id index_id partition_number hobt_id rows

    720575941183406082511479409172057594118340608502949

    720575941184061442511479407172057594118406144502949

    720575941184716802511479401172057594118471680502949

    how is this possible ? the same thing happens with large tables (usually i see 3 partitions) and medium tables (usually two partitions).

    thankx

    Wentu

    The number of rows is the same as the number of rows in the table itself.

  • A table may be stored on more than one partition even though it is not explicitly partitioned. I'm not sure about the exact rules that trigger the additional partitions, but I've seen this when going though backup files.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Also, if you are interested about how the tables are stored, it may be better to look at sys.data_spaces instead of sys.partitions. The sys.indexes data_space_id references the data_space_id in this view.

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply