Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.063 Beiträge
Delphi 12 Athens
|
AW: Postgre Query Performance Problem
27. Aug 2012, 16:55
Mit der neueren Join t-Syntax hast du es auch schonmal versucht?
SQL-Code:
SELECT sp.id_catalogpart AS "id", sp.id_station AS "id1", sp.id_location AS "id2", sum(sp.quantity) AS "count"
FROM mtx_stockparts sp
JOIN mtx_catalogparts cp ON sp.id_catalogpart = cp.id
JOIN cd_stations st ON sp.id_station = st.id
WHERE sp._entrytype = 0
AND st._deletedat IS NULL
AND sp._deletedat IS NULL
GROUP BY sp.id_catalogpart, sp.id_station, sp.id_location
Ob das so einen Unterschied ausmacht, weiß ich nicht.
SQL-Code:
SELECT sp.id_catalogpart AS "id", sp.id_station AS "id1", sp.id_location AS "id2", sum(sp.quantity) AS "count"
FROM mtx_stockparts sp
JOIN mtx_catalogparts cp ON sp.id_catalogpart = cp.id
JOIN cd_stations st ON st._deletedat IS NULL AND sp.id_station = st.id
WHERE sp._entrytype = 0 AND sp._deletedat IS NULL
GROUP BY sp.id_catalogpart, sp.id_station, sp.id_location
Neuste Erkenntnis:
Seit Pos einen dritten Parameter hat,
wird PoSex im Delphi viel seltener praktiziert.
Geändert von himitsu (27. Aug 2012 um 17:00 Uhr)
|