Using Delphi 2009 + Firebird 2.1.3.
Database is ODS 11.1, default char set is UTF8.
My prepared query is as follows:
SELECT
a.po_id, a.po_no
FROM
purchase_order a
WHERE EXISTS
(SELECT 1
FROM
sales_order_item z1
JOIN
purchase_order_item z2
ON
z2.so_item_id = z1.so_item_id
AND
z2.po_id = a.po_id
WHERE z1.so_id = :soid)
ORDER BY a.po_no
Now when I loop this say 1000 times because I have 1000 x so_id, the CPU usage get at 100% for FBSERVER.EXE
Anyone encountered this problem?