I have a table that has few million rows and I need the front end application to partition all the data for this table, or any other large table, using sql where clauses so I can retrieve all the data for the table in different threads for each "partition"
in parallel (I can't/do not need to know whether the table data is actually partitioned on any specific column at the server).
Assume that each "partition" can have n rows (dynamically), is there an easy way of find out what are the bounds for such partitions in terms of the table PK/unique index?
create table table_test (col1 char(8) primary key);
Example table data:
The bounds for table_test for partitions of 2 rows would be four partitions that have the following values for col1:
c, e, g
and the font end app would be able to use these bound to generate sql such as:
select * from test_table where col1 < 'c'; -- first partition
select * from test_table where col1 >= 'c' and col1 < 'e'; -- second partition
select * from test_table where col1 >= 'e' and col1 < 'g'; -- third partition
select * from test_table where col1 >= 'g'; -- fourth partition
So the question is whether the values 'c', 'e', 'g' bounds of the table data can be easily determined by using sql by the client font end.
View Complete Post