Re: [SQL] indexing for left join

2006-01-21 Thread Zulq Alam
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

Re: [SQL] indexing for left join

2006-01-19 Thread T E Schmitz
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

Re: [SQL] indexing for left join

2006-01-19 Thread T E Schmitz
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

Re: [SQL] indexing for left join

2006-01-19 Thread Richard Huxton
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

Re: [SQL] indexing for left join

2006-01-19 Thread Rod Taylor
> 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