Re: [GENERAL] Join Bad Performance on different data types

2014-03-05 Thread Victor Yegorov
2014-03-05 6:53 GMT+02:00 Adarsh Sharma : > Anyhow working on finding the root cause. I would do the following: 1. Check your `default_statistics_target`, like: SHOW default_statistics_target; 2. Your previously posted `EXPLAIN ANALYZE` with `set enable_seqscan=off` shows a signif

Re: [GENERAL] Join Bad Performance on different data types

2014-03-04 Thread Victor Yegorov
2014-03-04 10:19 GMT+02:00 Adarsh Sharma : > > PLAN > > > - > HashAggregate (cost=10651634346.70..10651780073.12 rows

Re: [GENERAL] Join Bad Performance on different data types

2014-03-04 Thread Sameer Kumar
On Tue, Mar 4, 2014 at 4:19 PM, Adarsh Sharma wrote: > Is dere any way i can rewrite the query so that i need not to set > seqscan-off, because i dont want to embed one more line in application > code and also dont want to change global setting in postgresql.conf to > disable seqscan. > You can

Re: [GENERAL] Join Bad Performance on different data types

2014-03-04 Thread Adarsh Sharma
On Tue, Mar 4, 2014 at 1:13 PM, Sameer Kumar wrote: > > On Tue, Mar 4, 2014 at 2:57 PM, Adarsh Sharma wrote: > >> I tried creating simple and gin indexes on the column(t_ids) but still >> not helping. Anyone has any idea or faced this before. Postgresql version >> is 9.2. >> > > have you done a va

Re: [GENERAL] Join Bad Performance on different data types

2014-03-03 Thread Pavel Stehule
Hello PostgreSQL doesn't use index when types on left and right part are not equal. Probably you lost some index - you can see a difference in EXPLAIN SELECT ... Regards Pavel 2014-03-04 7:57 GMT+01:00 Adarsh Sharma : > Hi, > > Today i need to change datatype of one of my tables from *bigint

Re: [GENERAL] Join Bad Performance on different data types

2014-03-03 Thread Sameer Kumar
On Tue, Mar 4, 2014 at 2:57 PM, Adarsh Sharma wrote: > I tried creating simple and gin indexes on the column(t_ids) but still not > helping. Anyone has any idea or faced this before. Postgresql version is > 9.2. > have you done a vacuum analyze or analyze after this step? You might have to disa

[GENERAL] Join Bad Performance on different data types

2014-03-03 Thread Adarsh Sharma
Hi, Today i need to change datatype of one of my tables from *bigint to bigint[] *due to application requirements. But One of my query hangs after this change :- select DISTINCT glt.id || ':' || gtt.name as id_type, glt.name, latitude, longitude, radius, latitude || ',' || longitude as latlon fro