Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a table of 3M rows.

I wanted to retrieve all those rows and do a visualization using dc.js.

Problem I have is, for just a single column it takes about 70 secs.

And If i write my query it takes about 240 secs to retrieve those rows.

I'm using using select query on columns like this.

SELECT COL1, COL2 FROM TABLE

That's it. No grouping, nothing.

But it takes hell lot of time.

Heard of indexing and I created a Index for the columns I use. But even though no fruitful results.

share|improve this question
    
Exact PostgreSQL version? EXPLAIN (BUFFERS, ANALYZE) ? –  Craig Ringer Feb 26 '14 at 12:17
    
Version is 9.1. And what's the buffers and analyze? I'm very new to this. –  user3206082 Feb 26 '14 at 12:18
    
1  
Could well be that most of this "query time" is spent in your ORM or frontend, or sending the results back over the line. Try submitting the same query in psql to see where the time is spent. –  wildplasser Feb 26 '14 at 12:29
    
I've got about 9 rows of result using the EXPLAIN. You want those results? –  user3206082 Feb 26 '14 at 12:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.