I have 256 tables in my production database. Each table has around 10,000,000 rows -- I can't get all of the rows from any one table in one SELECT
query.
Actually I put the query-phases in solr/conf/data-config.xml just like this as a test; it has one table and I'm selecting all rows.
I use Solr (which is based on Java). And I trigger the indexing of the data like so:
curl --max-time 36000 -i localhost:portNum/solr/dataimport?command=full-import
This is what's in the XML:
<entity name="file" query="SELECT *, LOWER(REPLACE(sw_name, ' ', '')) packed_sw_name, CAST(group_id as char) group_id_s FROM tblTmp1"/>
But now, I want to get the parameter for table number(tblNum) for data-import and select rows between id ranges iteratively -- with dollar-sign variable substitution, the query would look like this:
<entity name="file" query="SELECT *, LOWER(REPLACE(sw_name, ' ', '')) packed_sw_name, CAST(group_id as char) group_id_s FROM tblTmp1_
$tblNumwhere id >=
$startSnand id<
$endSn" />
How can I query the database iteratively, and in which file should I set this up?