Home > Archive > PostgreSQL JDBC > December 2005 > Re: Advise on mapping JTable to large PostgreSQL table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Advise on mapping JTable to large PostgreSQL table
Kris Jurka

2005-12-06, 11:24 am



On Tue, 6 Dec 2005, Joost Kraaijeveld wrote:

> I *must* (as in: I have no choice and it can't be solved another way by
> customer demand) display a large table (> 1.100.000 records) in a JTable
> ( or something that looks like a JTable for the customer).
>
> AS a JTable works with rows, so I have written code that calculates the
> row of the record in the query and maps any row request to an index in
> the query.
>
> 1. Customer wants the record with 'some text' in column 'a'
> 2. I calculate the index:
> select count(*) from table where a < 'some text'


There's got to be a better way of storing this index. If this is readonly
data then you could easily number all of these in the database itself. I
think the problem may be that you are trying to index all this data as an
array where you need an absolute offset. Perhaps a different data
structure would make a better backing type?

> 4. If not, I get 100 records before and after the requested record,
> including the record itself and put them in the local cache so that
> JTable can call AbstratTableModel. getValueAt(row,colum
n) without the
> need of accessing the database.


How do you determine the records before and after at the moment?

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com