Many questions - Mailing list pgsql-sql

From raptor
Subject Many questions
Date
Msg-id 37F260F7.920D67DB@unacs.bg
Whole thread Raw
List pgsql-sql
hi,

I have several quesions.

1. Does $dbh->prepare_cached has some impact on performance for
PostgresSQL ? I read the TODO of mod_perl docs :"). But there is
discussion only for MySQL & Oracle.

2. Is this the right way to make transactions with DBI :

eval{ local $h->{RaiseError} = 0 if $h->{RaiseError}; local $h->{AutoCommit} = 0 if $h->{AutoCommit};.... do something
SELECT,INSERT, UPDATE ....}
 
if ($@) {$dbh->rollback}else {$dbh->commit};

after it RaiseError & AutoCommit has their default values ?

3. Is it a good idea at the end of the script to clear the hash - in a
perspective of mod_perl. The hash may become very large ?
-->  %hash = ();

HINT : try this to see memory usage of httpd deamons including SHARED
memory. You can't see it with "ps".

top -b -n 1 | grep -e "httpd\|PID" | cut -b '0-5,24-40'


4. What is the best way to implement something like NextPage, PrevPage
(+PageSize) for the DBI query.
Something like ADO/IIS similar methods.
SELECT ... LIMIT,OFFSET ... stuff ?!?!

5. At the moment I'm using global.asa (ASP.pm) to store some sub's that
I use in most of my pages. Is that the right way to do this ? Examples.

6. I saw that the :

CREATE UNIQUE INDEX xx ON yy (col1,col2);

is different from :
CREATE UNIQUE INDEX xx ON yy (col1);
CREATE UNIQUE INDEX xx ON yy (col2);

is the same true for CREATE INDEX (not unique). Is there way to make
UNIQUE case insensitive.

7. How to drop all indexes at once ?

Thanx
=====
iVAN
raptor@unacs.bg
=====



pgsql-sql by date:

Previous
From: Stuart Rison
Date:
Subject: [SQL] How about a postgreSQL cookbook? (was [SQL] Subselect performance)
Next
From: Daniel Péder
Date:
Subject: extended cursor-FETCH usage