Skip site navigation (1) Skip section navigation (2)

Re: Advise on mapping JTable to large PostgreSQL table

From: Kris Jurka <books(at)ejurka(dot)com>
To: Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Advise on mapping JTable to large PostgreSQL table
Date: 2005-12-06 15:57:21
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc

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,column) without the
> need of accessing the database.

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

Kris Jurka

In response to


pgsql-jdbc by date

Next:From: Tom LaneDate: 2005-12-06 17:07:57
Subject: Re: More about deadlock
Previous:From: marcusDate: 2005-12-06 15:56:07
Subject: В аренду офисы 300-28000 класса «В+»

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group