[HACKERS] Adding some new operators

2001-06-06 Thread Feng Tian
Hi, I am trying to use postgresql in a research project. I need to add several new operators, some will probably take more than 2 input tuple streams. The new operator will be considered by optimizer when estimating cost and choosing a plan. Can anyone tell me how hard this will be? And where

[HACKERS] Adding some new operators

2001-06-11 Thread Feng Tian
Hi, I am trying to use postgresql in some research project. I need to add some new operators, some will probably take more than 2 input tuple streams. The new operator will be considered by optimizer when estimating cost and choosing a plan. Can anyone tell me how hard this will be? And where

[HACKERS] libpq connectoin redirect

2010-04-21 Thread feng tian
Hi, I want to load balance a postgres server on 4 physical machines, say 127.0.0.11-14. I can set up a pgbouncer on 127.0.0.10 and connection pooling to my four boxes. However, the traffic from/to clients will go through an extra hop. Another way to do this, is to send the client an

Re: [HACKERS] libpq connectoin redirect

2010-04-22 Thread feng tian
and everything else happens automatically. Thanks, Subject: Re: [HACKERS] libpq connectoin redirect From: li...@jwp.name Date: Wed, 21 Apr 2010 15:52:39 -0700 CC: pgsql-hackers@postgresql.org To: ft...@hotmail.com On Apr 20, 2010, at 10:03 PM, feng tian wrote: Another way to do this, is to send

Re: [HACKERS] libpq connectoin redirect

2010-04-22 Thread feng tian
just redirect to the right box according to database/user. The 4 boxes I have may not even get domain name or static IP. Another scenario, if I have some kind of replication set up, I can send transaction processing to master and analytic reporting query to slaves. Thanks, Feng feng tian wrote

Fwd: [HACKERS] Vitesse DB call for testing

2014-10-17 Thread Feng Tian
Hi, Tom, Sorry for double post to you. Feng -- Forwarded message -- From: Feng Tian ft...@vitessedata.com Date: Fri, Oct 17, 2014 at 10:29 AM Subject: Re: [HACKERS] Vitesse DB call for testing To: Tom Lane t...@sss.pgh.pa.us Hi, Tom, I agree using that using int128 in stock

[HACKERS] Optimizer on sort aggregate

2014-10-17 Thread Feng Tian
Hi, Consider the following queries. create table t(i int, j int, k int, t text); insert into t select i, i % 100, i % 1000, 'AABBCCDD' || i from generate_series(1, 100) i; ftian=# explain select count(distinct j) from t group by t, i; QUERY PLAN

Re: [HACKERS] Optimizer on sort aggregate

2014-10-17 Thread Feng Tian
with a domain prefix). I don't see any downside of sort bytea, other than lost the interest ordering. Thanks, Feng On Fri, Oct 17, 2014 at 4:36 PM, David Rowley dgrowle...@gmail.com wrote: On Sat, Oct 18, 2014 at 5:10 AM, Feng Tian feng...@gmail.com wrote: Hi, Consider the following queries. create

Re: [HACKERS] Let's drop two obsolete features which are bear-traps for novices

2014-11-03 Thread Feng Tian
Hi, This is Feng from Vitesse. Performance different between Money and Numeric is *HUGE*. For TPCH Q1, the performance difference is 5x for stock postgres, and ~20x for vitesse. Stock postgres, for my laptop, TPCH 1G, Q1, use money type ~ 9s, use Numeric (15, 2) is ~53s. Kevin, test=# do

Re: [HACKERS] pretty bad n_distinct estimate, causing HashAgg OOM on TPC-H

2015-06-20 Thread Feng Tian
On Wed, Jun 17, 2015 at 10:52 AM, Tomas Vondra tomas.von...@2ndquadrant.com wrote: Hi, I'm currently running some tests on a 3TB TPC-H data set, and I tripped over a pretty bad n_distinct underestimate, causing OOM in HashAgg (which somehow illustrates the importance of the memory-bounded

Re: [HACKERS] pretty bad n_distinct estimate, causing HashAgg OOM on TPC-H

2015-06-20 Thread Feng Tian
On Sat, Jun 20, 2015 at 7:56 AM, Tomas Vondra tomas.von...@2ndquadrant.com wrote: Hi, On 06/20/2015 08:54 AM, Feng Tian wrote: While better sample/stats is important for choosing a good plan, in this query, hash agg is really the right plan. If a sort agg is chosen, the performance

[HACKERS] Float/Double cast to int

2015-05-21 Thread Feng Tian
Hi, Hackers, Here is a query, server was built witch GCC on Linux, AMD64. ftian=# ftian=# select 1.5::int, 1.5::double precision::int, 314.5::int, 314.5::double precision::int; int4 | int4 | int4 | int4 --+--+--+-- 2 |2 | 315 | 314 (1 row) I believe this is because

Re: [HACKERS] Float/Double cast to int

2015-05-21 Thread Feng Tian
be quite hard to explain this behavior to customer. Maybe it is time to be brave, and be compatible with reality instead of backward? Best, Feng On Thu, May 21, 2015 at 12:01 PM, Tom Lane t...@sss.pgh.pa.us wrote: Feng Tian ft...@vitessedata.com writes: Here is a query, server was built witch

Re: [HACKERS] Using quicksort for every external sort run

2015-08-20 Thread Feng Tian
On Thu, Aug 20, 2015 at 1:16 PM, Peter Geoghegan p...@heroku.com wrote: On Thu, Aug 20, 2015 at 12:42 PM, Feng Tian ft...@vitessedata.com wrote: Just a quick anecdotal evidence. I did similar experiment about three years ago. The conclusion was that if you have SSD, just do quick sort

Re: [HACKERS] Using quicksort for every external sort run

2015-08-20 Thread Feng Tian
On Thu, Aug 20, 2015 at 10:41 AM, Peter Geoghegan p...@heroku.com wrote: On Thu, Aug 20, 2015 at 8:15 AM, Simon Riggs si...@2ndquadrant.com wrote: On 20 August 2015 at 03:24, Peter Geoghegan p...@heroku.com wrote: The patch is ~3.25x faster than master I've tried to read this post

[HACKERS] Decimal64 and Decimal128

2015-09-24 Thread Feng Tian
Hi, Here is an extension for 64 and 128 bit decimal types using IEEE decimal floating point. The original idea/implementation is from http://pgxn.org/dist/pgdecimal/1.0.0/ Original thread for dicussion is at

Re: [HACKERS] Decimal64 and Decimal128

2015-09-24 Thread Feng Tian
On Thu, Sep 24, 2015 at 1:55 PM, Peter Geoghegan wrote: > On Thu, Sep 24, 2015 at 1:53 PM, Tom Lane wrote: > > Please include the actual patch as an attachment. We do not consider > mere > > URLs to be acceptable patch submission format, because that

Re: [HACKERS] Decimal64 and Decimal128

2015-09-24 Thread Feng Tian
On Thu, Sep 24, 2015 at 2:17 PM, Feng Tian <ft...@vitessedata.com> wrote: > > > On Thu, Sep 24, 2015 at 1:55 PM, Peter Geoghegan <p...@heroku.com> wrote: > >> On Thu, Sep 24, 2015 at 1:53 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: >> > Please incl

Re: [HACKERS] Decimal64 and Decimal128

2015-09-24 Thread Feng Tian
On Thu, Sep 24, 2015 at 1:29 PM, Feng Tian <ft...@vitessedata.com> wrote: > Hi, > > Here is an extension for 64 and 128 bit decimal types using IEEE decimal > floating point. The original idea/implementation is from > http://pgxn.org/dist/pgdecimal/1.0.0/ Original

Re: [HACKERS] Fdw cleanup

2015-12-14 Thread Feng Tian
the context (fdw_state). I took a look at postgres_fdw and found that xact callback is exactly what is done.So I will take this approach. Again, thank you Albe, for pointing me to it. Feng On Mon, Dec 14, 2015 at 12:30 AM, Albe Laurenz <laurenz.a...@wien.gv.at> wrote: > Feng Tian wro

[HACKERS] Fdw cleanup

2015-12-13 Thread Feng Tian
Hi, Hackers, I need some help to understand foreign table error handling. For a query on foreign table, ExecInitForeignScan is called, which in turn calls the BeginForeignScan hook. Inside this hook, I allocated some resource, node->fdw_state = allocate_resource(...); If everything goes

Re: [HACKERS] POC, WIP: OR-clause support for indexes

2015-12-26 Thread Feng Tian
Hi, Teodor, This is great. I got a question, is it possible make btree index to support OR as well? Is btree supports more invasive, in the sense that we need to do enhance ScanKey to supports an array of values? Thanks, Feng On Sat, Dec 26, 2015 at 10:04 AM, Teodor Sigaev

Re: [HACKERS] Remove Windows crash dump support?

2015-12-27 Thread Feng Tian
On Wed, Dec 23, 2015 at 6:14 PM, Craig Ringer wrote: > On 22 December 2015 at 23:48, Alex Ignatov > wrote: > > >> I think that you can debug crash dump since windbg exists. >> > > Nobody in their right mind uses windbg though. Visual Studio is

[HACKERS] Bug with int2

2016-02-16 Thread Feng Tian
I run into the following. Seems this is a bug for -32768, which should be a valid smallint value. Test was run on 9.4.5. Thanks, Feng ftian=# select 32767::int2; int2 --- 32767 (1 row) ftian=# select -32767::int2; ?column? -- -32767 (1 row) ftian=# select 32768::int2;

Re: [HACKERS] Bug with int2

2016-02-16 Thread Feng Tian
Ah, thanks! On Tue, Feb 16, 2016 at 7:54 PM, Peter Geoghegan <p...@heroku.com> wrote: > On Tue, Feb 16, 2016 at 7:27 PM, Feng Tian <ft...@vitessedata.com> wrote: > > I run into the following. Seems this is a bug for -32768, which should > be > > a valid smalli

[HACKERS] FDW: should GetFdwRoutine be called when drop table?

2016-02-19 Thread Feng Tian
Hi, Hackers, I have an fdw that each foreign table will acquire some persisted resource. In my case, some files in file system. To drop the table cleanly, I have written an object_access_hook that remove those files. The hook is installed in _PG_init. It all worked well except one case.