By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Query about 20,000 record problem(slow)

P: 17
I've been making a program for inventory system using java with a database using postgresql.

My problem is, when I query the 20,000 data from my database at one time is slow or it will took 3-5 seconds to retrieve the data. What is the best way or solution to optimize my query? Any suggestion. Thanks

ps. I am just using a single pc for my database and program.
Sep 24 '07 #1
Share this Question
Share on Google+
4 Replies


Expert 100+
P: 700
I've been making a program for inventory system using java with a database using postgresql.

My problem is, when I query the 20,000 data from my database at one time is slow or it will took 3-5 seconds to retrieve the data. What is the best way or solution to optimize my query? Any suggestion. Thanks

ps. I am just using a single pc for my database and program.
Maybe you should consider partitioning your tables.
Do you vacuum your db regullary? Do you create any indexes?
Show your query.
Sep 24 '07 #2

P: 17
I did perform that one already, is there any command to optimize the search or speed up the search?

My query is just this one.
When i click a button on my program, it will display in the table.

SELECT * FROM product ---- but the product have 20,0000 record.

Thanks All.
Sep 24 '07 #3

Expert 100+
P: 700
I did perform that one already, is there any command to optimize the search or speed up the search?

My query is just this one.
When i click a button on my program, it will display in the table.

SELECT * FROM product ---- but the product have 20,0000 record.

Thanks All.
Is it usefull to show 20000 rows? I don't get it why you're doing this query. (sorry for my poor english)
Sep 24 '07 #4

P: 17
Yes it's useful in my program because I'll put the 20,000 data on my JComboBox/JTable at one click of the button. What can you suggest about this problem?(no problem on that)
Sep 24 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.