I did do a vacuum analyze after the indexes were created.
Here's the more complicated JOIN I'm trying along with the EXPLAIN results for it:
select station.statid, station.code, division.divenumber, dept.depenumber, station.name,
station.number, station.assist, station.assistno, station.stationtypeid, station.overhead, station.jack,
station.circuit, station.date, station.deptid, dept.code as deptcode, dept.ename, dept.divid,
division.code as divcode, division.ename, station.stationcharge, station.location, station.room,
station.phone2, station.email, stntype.name as type, station.directorystation,
station.callaccountingstation, esite.sitecode, station.siteid, station.multiset, station.customflag,
station.aux1, station.aux2, station.cos from esite right join (division inner join (dept inner
join (station left join stntype on station.stationtypeid = stntype.stationtypeid) on dept.deptid =
station.deptid) on division.divid = dept.divid) on esite.siteid = station.siteid order by station.name;
NOTICE: QUERY PLAN:
Hash Join (cost=23.58..10849.20 rows=99297 width=36)
-> Hash Join (cost=22.56..9110.49 rows=99297 width=32)
-> Hash Join (cost=21.43..7371.65 rows=99297 width=28)
-> Hash Join (cost=1.07..5613.61 rows=99297 width=20)
-> Seq Scan on station (cost=0.00..5115.97 rows=99297 widt
h=16)
-> Hash (cost=1.06..1.06 rows=6 width=4)
-> Seq Scan on stntype (cost=0.00..1.06 rows=6 width
=4)
-> Hash (cost=18.48..18.48 rows=748 width=8)
-> Seq Scan on dept (cost=0.00..18.48 rows=748 width=8)
-> Hash (cost=1.11..1.11 rows=11 width=4)
-> Seq Scan on division (cost=0.00..1.11 rows=11 width=4)
-> Hash (cost=1.01..1.01 rows=1 width=4)
-> Seq Scan on esite (cost=0.00..1.01 rows=1 width=4)
The times that were in the milliseconds to read the first record were when I had the table in Access (in another mdb and linked). Even on another machine on the network the times for a linked Access table were in milliseconds. There's no other network traffic here on my 100 Base T network.
Also I was seeing Postgres only put 18K or so on the network to get the first record of the query. But again, Postgres was taking 90 to 200 seconds using a linked table in Access (ODBC DSN), or using ODBCDirect just to get the first record read with my VB code in Access.
If anyone has any ideas, I'd greatly appreciate it! Thanks!