How Partitioning works

Copper Contributor

Good afternoon,
I can't find any information about how partitioning works inside SQL Server.
Faced with a situation. Example:
There is a table with lists (id,category,price,idPart), where there is an identifier that works for partitioning.
12 partitions from 0 to 12
Please tell me why the query for the partition field is slower
SELECT id,category,price FROM dbo.myTable WHERE id Part = 1
And the query using the partition function works faster
SELECT id,category,price FROM dbo.myTable WHERE $PARTITION.pf(idPart) = 1

1 Reply
Check the execution plan of both queries.