[HACKERS] Compiling PG on linux

2007-12-06 Thread Manolo _

I'm trying to compile PG on Ubuntu in order to hack tuplesort.c code
I just downloaded and unpacked the source code and red README and INSTALL files.

I'm going to

./configure --enable-debug --enable-cassert --enable-depend

then I would

make
make install

Can I improve something adding some missing option/command to the above steps?
Where and how to apply the TRACE_SORT option?
Any other useful options?

Sorry, I'm not so expert on Linux/PostgreSQL/gcc/make etc etc.

Thanks for your time.


 Date: Mon, 26 Nov 2007 11:09:54 -0800
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 CC: pgsql-hackers@postgresql.org
 Subject: Re: [HACKERS] Replacement Selection
 
 [EMAIL PROTECTED] wrote:
 I also implemented 
 Replacement Selection (RS) so if I'm able to integrate my RS I hope I 
 would be able to integrate the others too.
 
 The existing code implements RS. Tom asked you to describe what improvements 
 you hope to make; I'm confident that he already understands how to implement 
 RS. :-)
 
 **
 
 Why don't you compile with TRACE_SORT enabled and watch the log output.
 
 The function in tuplesort.c that you should start with is puttuple_common().
 
 in puttuple_common(), the transition from an internal to external sort is 
 performed at the bottom of the TSS_INITIAL case in the main switch 
 statement. The function dumptuples() heapifies the in-core tuples (divides 
 the in-core tuples into initial runs and then advances the state to 
 TSS_BUILDRUNS). All subsequent tuples will hit the TSS_BUILDRUNS case and 
 will insert tuples into the heap; emitting tuples for the current run as it 
 goes.
 
 I recommend you run the code in the debugger on a external-sorting query: 
 watch two or three tuples go into the heap and you'll get the idea.
 
 The top of the heap is at state-memtuples[0] the heap goes down from there. 
 New tuples are added there and the heap is adjusted (Using the 
 tuplesort_heap_siftup() function).
 
 -Tim

_
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [HACKERS] Compiling PG on linux

2007-12-06 Thread Joshua D. Drake

Manolo _ wrote:

I'm trying to compile PG on Ubuntu in order to hack tuplesort.c code
I just downloaded and unpacked the source code and red README and INSTALL files.

I'm going to

./configure --enable-debug --enable-cassert --enable-depend

then I would

make
make install

Can I improve something adding some missing option/command to the above steps?
Where and how to apply the TRACE_SORT option?
Any other useful options?


You don't want --enable-cassert on a production machine it is a 
performance hit.


Joshua D. Drake




---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [HACKERS] Compiling PG on linux

2007-12-06 Thread Alvaro Herrera
Manolo _ wrote:
 
 I'm trying to compile PG on Ubuntu in order to hack tuplesort.c code
 I just downloaded and unpacked the source code and red README and INSTALL 
 files.
 
 I'm going to
 
 ./configure --enable-debug --enable-cassert --enable-depend
 
 then I would
 
 make
 make install

 Can I improve something adding some missing option/command to the above steps?

Maybe you would want to change -O2 to -O0 in CFLAGS so that debugging is
easier (you will eventually need it).

 Where and how to apply the TRACE_SORT option?

Use pg_config_manual.h.

-- 
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
Si quieres ser creativo, aprende el arte de perder el tiempo

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


Re: [HACKERS] Compiling PG on linux

2007-12-06 Thread Andrew Dunstan



Joshua D. Drake wrote:

Manolo _ wrote:


./configure --enable-debug --enable-cassert --enable-depend



You don't want --enable-cassert on a production machine it is a 
performance hit.





He's clearly not setting up for production, but for development, where 
cassert is quite appropriate.


cheers

andrew

---(end of broadcast)---
TIP 4: Have you searched our list archives?

  http://archives.postgresql.org