Skip to content

Instantly share code, notes, and snippets.

@gwillem
Created January 15, 2014 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwillem/8436730 to your computer and use it in GitHub Desktop.
Save gwillem/8436730 to your computer and use it in GitHub Desktop.
Magento url indexer partitioning
SELECT
CONCAT(r.identifier, CASE WHEN ur.inc IS NULL OR `m`.`value` = 1 THEN '' ELSE CONCAT('-', ur.inc) END) AS `request_path`,
`r`.`target_path`,
'3beb48718b9de2b903447079560756bc' AS `guid`,
0 AS `is_system`,
CONCAT(r.identifier, CASE WHEN ur.inc IS NULL OR `m`.`value` = 1 THEN '' ELSE CONCAT('-', ur.inc) END) AS `identifier`,
`r`.`redirect_id` AS `value_id`,
`r`.`store_id`, 1 AS `entity_type`
FROM `enterprise_url_rewrite_redirect` AS `r`
LEFT JOIN `enterprise_url_rewrite` AS `ur` ON ur.identifier = r.identifier AND ur.store_id = r.store_id AND ur.entity_type = 1
LEFT JOIN `enterprise_index_multiplier` AS `m` ON ur.identifier IS NOT NULL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment