Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. SELECT
  2. *
  3. FROM
  4. product p INNER JOIN productStore ps ON p.productUUID = ps.productUUID
  5. ORDER BY
  6. ps.storeTitle
  7. LIMIT 50;
  8.  
  9. id select_type table type possible_keys key key_len ref rows Extra
  10. 1 SIMPLE ps ALL PRIMARY NULL NULL NULL 942187 Using filesort
  11. 1 SIMPLE p eq_ref PRIMARY PRIMARY 16 foeniks_core.ps.productUUID 1 NULL
  12.  
  13. id select_type table type possible_keys key key_len ref rows Extra
  14. 1 SIMPLE ps ALL PRIMARY NULL NULL NULL 942187 NULL
  15. 1 SIMPLE p eq_ref PRIMARY PRIMARY 16 foeniks_core.ps.productUUID 1 NULL
  16.  
  17. CREATE TABLE `productStore` (
  18. `productUUID` binary(16) NOT NULL,
  19. `storeUUID` binary(16) NOT NULL,
  20. `distributorLastUsed` binary(16) DEFAULT NULL,
  21. `storeTitle` varchar(282) DEFAULT NULL,
  22. `storeUrl` varchar(282) DEFAULT NULL,
  23. `storeDescription` text,
  24. `storeDescriptionDemo` text,
  25. `storePrice` int(11) NOT NULL DEFAULT '0',
  26. `storePriceNext` int(11) NOT NULL DEFAULT '0',
  27. `storePriceCost` int(11) NOT NULL DEFAULT '0',
  28. `overwrites` int(11) NOT NULL DEFAULT '0',
  29. `updated` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  30. `added` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  31. `allowDisplay` tinyint(1) NOT NULL DEFAULT '0',
  32. `activated` tinyint(1) NOT NULL DEFAULT '1',
  33. PRIMARY KEY (`productUUID`,`storeUUID`),
  34. KEY `productStoreLanguageToStore_idx` (`storeUUID`),
  35. KEY `productStoreToDistributor_idx` (`distributorLastUsed`),
  36. KEY `storeUrl` (`storeUrl`(180)) USING BTREE,
  37. KEY `testStoreTitle` (`storeTitle`(182)),
  38. CONSTRAINT `productStoreToDistributor` FOREIGN KEY (`distributorLastUsed`) REFERENCES `distributor` (`distributorUUID`) ON DELETE SET NULL ON UPDATE CASCADE,
  39. CONSTRAINT `productStoreToProduct` FOREIGN KEY (`productUUID`) REFERENCES `product` (`productUUID`) ON DELETE CASCADE ON UPDATE CASCADE,
  40. CONSTRAINT `productStoreToStore` FOREIGN KEY (`storeUUID`) REFERENCES `store` (`storeUUID`) ON DELETE CASCADE ON UPDATE CASCADE
  41. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement