|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, March 04, 2013 12:23 PM
Points: 7,
Visits: 147
|
|
Could you tell me what do you mean by create a non-aligned index on that field. Is there any example.
I used following code:
--------------This took 6 minutes on partition table
use mydb
go
declare @P1 char(9)
set @P1=' '
SELECT top 1000 a.t_hrea,a.t_bpid,a.t_bprt,a.t_dtbl,a.t_dtrl,a.t_erdt,a.t_lobl,a.t_lorl,a.t_opon,a.t_orno,a.t_pono,a.t_pstc,a.t_rlam,a.t_rlty,a.t_sqnb
FROM dbo.ttdsls421900_par a
WHERE (a.t_orno > @P1) ORDER BY 10,11,15,1,4 OPTION (FAST 5)
--------------This took seconds on non-partition table
use mydb
go
declare @P1 char(9)
set @P1=' '
SELECT top 1000 a.t_hrea,a.t_bpid,a.t_bprt,a.t_dtbl,a.t_dtrl,a.t_erdt,a.t_lobl,a.t_lorl,a.t_opon,a.t_orno,a.t_pono,a.t_pstc,a.t_rlam,a.t_rlty,a.t_sqnb
FROM dbo.ttdsls421900 a
WHERE (a.t_orno > @P1) ORDER BY 10,11,15,1,4 OPTION (FAST 5)
---------------------
If I remove ORDER BY Clause from code and run against partition table it will give same result as non partition table.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 10:06 AM
Points: 168,
Visits: 635
|
|
Aligned index (separate indexes split by partition):
create index ix_pt_index on partitioned_table (indexed_value) ON [ps_PartitionScheme](partition_key) --Name of partition scheme
Non-aligned index (one index that covers all values across all partitions):
create index ix_index on partitioned_table (indexed_value) ON [FG_Index] --Name of filegroup
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, March 04, 2013 12:23 PM
Points: 7,
Visits: 147
|
|
| You mean non partition index. I did created cluster index ( non allign) on partition table and after that Partition table became non partition table.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Today @ 10:06 AM
Points: 168,
Visits: 635
|
|
| Yes I meant a nonclustered index.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, March 04, 2013 12:23 PM
Points: 7,
Visits: 147
|
|
for example when I creted cluster index, partition table lost the partition scheme and becomes non partion. And when I created just the non cluster index , execution plan doesnt take this index and keeps go to sort 92%.
Thanks
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, April 30, 2009 2:59 PM
Points: 1,
Visits: 0
|
|
Great article presented with very easy to follow and implement approach.
Rashid Akhter, PMP Project Manager, Scrum Master
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Saturday, May 04, 2013 11:13 AM
Points: 9,855,
Visits: 9,374
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, May 06, 2013 9:00 AM
Points: 9,
Visits: 496
|
|
| Do you plan to update your article with the correct t-sql?
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, November 20, 2009 8:03 AM
Points: 1,
Visits: 7
|
|
| Does any one know if partitioning on two fields is possible? I guess worst case I'd could combine two fields into one and do it that way but then I have to have all of the TSQL written with the concatenation...pretty ugly. I haven't been able to find anything on this on the web. I'd like to partition a table by geography and year. Thanks for any help.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Wednesday, March 06, 2013 9:30 PM
Points: 60,
Visits: 96
|
|
tomtait415 (9/23/2009) Does any one know if partitioning on two fields is possible? I guess worst case I'd could combine two fields into one and do it that way but then I have to have all of the TSQL written with the concatenation...pretty ugly. I haven't been able to find anything on this on the web. I'd like to partition a table by geography and year. Thanks for any help. AFAIK the only way to partition on multiple columns is to use a computed column.
|
|
|
|