I am new to PostgreSQL but isn't this query the same as doing an INNER
JOIN?
For a true LEFT JOIN should it not be as follows?
SELECT ITEM.ITEM_PK
FROM ITEM
LEFT JOIN SERIAL_NO ON SERIAL_NO.ITEM_FK = ITEM.ITEM_PK
AND SERIAL_NO.NO ='WX1234'
GROUP BY ITEM.ITEM_PK
Using an AND instead of WHERE fo
Rod Taylor wrote:
Sequential despite the indices? Or is this because the tables of my test
DB are virtually empty?
This is it. PostgreSQL changes strategies with data load. Performance
testing must be done on an approximation of the real data (both values
and size).
Thanks for your responses
Milorad Poluga wrote:
Try to execute this modification of your query :
SELECT ITEM.ITEM_PK FROM ITEM
LEFT JOIN SERIAL_NO
ON ( SERIAL_NO.ITEM_FK = ITEM.ITEM_PK
AND SERIAL_NO.NO ='WX1234' )
GROUP BY ITEM.ITEM_PK
SELECT ITEM.ITEM_PK FROM ITEM
LEFT JOIN SERIAL_NO O
T E Schmitz wrote:
Sequential despite the indices? Or is this because the tables of my test
DB are virtually empty?
Yes - read up on analyse and column statistics for details. Oh, you've
probably missed about vacuuming too.
--
Richard Huxton
Archonet Ltd
---(en
> Sequential despite the indices? Or is this because the tables of my test
> DB are virtually empty?
This is it. PostgreSQL changes strategies with data load. Performance
testing must be done on an approximation of the real data (both values
and size).
--
---(end of br