[SQL] BITMAP INDEXES...

2002-08-22 Thread Rajesh Kumar Mallah.

Hi,

I have learnt from certain texts  that bitmap indexes are very useful for
large DSS (decesion support systems).

bitmap indexes are currently not available in postgresql.

My question is in what way is a normal btree index in pgsql
inferior to bitmap indexes (found in oracle for example).

is it just in terms of space requirements for performance too?


regds
mallah.


-- 
Rajesh Kumar Mallah,
Project Manager (Development)
Infocom Network Limited, New Delhi
phone: +91(11)6152172 (221) (L) ,9811255597 (M)

Visit http://www.trade-india.com ,
India's Leading B2B eMarketplace.



---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



[SQL] Separating data sets in a table

2002-08-22 Thread Andreas Tille

Hello,

I want to solve the following problem:

CREATE TABLE Ref( Id int ) ;
CREATE TABLE Import ( Idint,
  Other varchar(42),
  Flag  int,
  Tstimestamp ) ;
CREATE TABLE Data   ( Idint,
  Other varchar(42) ) ;

The table Import will be filled by a COPY FROM statement and contains
no checks for referential integrity.  The columns Id and Other have to
be moved to the table Data if the table Ref contains the Id.  If not
Flag should get a certain value that something went wrong.  Moreover
Import should only contain one representation  of a dataset with equal
Id and Other column and I would like to store the newest one (this
is the reason for the timestamp).

I tried to do the following approach:

   CREATE LOCAL TEMPORARY TABLE ImportOK () INHERITS (Import) ;

   INSERT INTO ImportOK SELECT * FROM Import i
  INNER JOIN  Ref r ON i.Id = r.Id;

   DELETE FROM Import WHERE Id IN (SELECT Id FROM ImportOK) ;

The idea was that the latest statement should get rid of all valid
data sets from Import.  The valid datasets now could be moved to Data
and I could afterwards check Import for duplicated data sets.
Unfortunately the latest statement is so terribly slow that I can't
imagine that there is a better way to do this.

It seems like a very beginner question but I have no real clue how
to do this right.  Probably the solution has to be done completely
different.

Thanks for your patience

  Andreas.


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

http://www.postgresql.org/users-lounge/docs/faq.html



Re: [SQL] Problem with timestamp field/time function.. (upgrading

2002-08-22 Thread Lucas Brasilino

Hi Stephan

>>  So, how can I get the same result above without using time() ??
>>Or if it not possible, how can I extract (yes, I tried with extract()
>>function too) time from a timestamp column?
>>  I know it's quite simple question... but I haven't find any clue!
>>
> 
> In general you could probably use CAST(materiadata as time) I'd guess.
> I believe that at this point you can still use the functions, you just
> need to double quote them ("time"(materiadata)) to differentiate them
> from the type specifiers.
> 

Well, it seems to work only with "timestamp without time zone" type. But 
worked. Thanks a lot.
For me it's a new approching not using functions such as time, but 
"casting" it to a "time" type ( like select materiadata::time from 
materia;).
If PostgreSQL development group change it's point of view, I suppose 
there's some advantage. Do you know some advantages ??

bests regards
-- 

[]'s
Lucas Brasilino
[EMAIL PROTECTED]
http://www.recife.pe.gov.br
Emprel -Empresa Municipal de Informatica (pt_BR)
Municipal Computing Enterprise (en_US)
Recife - Pernambuco - Brasil
Fone: +55-81-34167078


---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



[SQL] bytea etc.

2002-08-22 Thread Andrew Klimov
Hi , All!
 
Could someone clarify me  :
 
When I want to store BLOB's internally in database (for example jpeg )
should I use bytea or OID? Is OID something like BFILE in Oracle 8i?
 
If both are appropriate for internal BLOB why I can't use
 
update image set picture=lo_import('Myfile') where image_code='blablabla' ;
 
with bytea column type but only with OID column type?
 
 
And one more thing:
Where is function byteain documented?
 
TIA,
Andrew.Do You Yahoo!?
HotJobs, a Yahoo! service - Search Thousands of New Jobs

Re: [SQL] Problem with timestamp field/time function.. (upgrading

2002-08-22 Thread Stephan Szabo


On Thu, 22 Aug 2002, Lucas Brasilino wrote:

> Hi Stephan
>
> >>So, how can I get the same result above without using time() ??
> >>Or if it not possible, how can I extract (yes, I tried with extract()
> >>function too) time from a timestamp column?
> >>I know it's quite simple question... but I haven't find any clue!
> >>
> >
> > In general you could probably use CAST(materiadata as time) I'd guess.
> > I believe that at this point you can still use the functions, you just
> > need to double quote them ("time"(materiadata)) to differentiate them
> > from the type specifiers.
> >
>
>   Well, it seems to work only with "timestamp without time zone" type. But
> worked. Thanks a lot.
>   For me it's a new approching not using functions such as time, but
> "casting" it to a "time" type ( like select materiadata::time from
> materia;).
>   If PostgreSQL development group change it's point of view, I suppose
> there's some advantage. Do you know some advantages ??

time(n) and timestamp(n) refer to a type which I believe gives n digits of
fractional seconds in SQL. Compatibility for that SQL feature was added
but the syntax collided with the old usage.  In any case the old time()
etc were actually typecasts since it was a direct call to the type casting
function.



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

http://archives.postgresql.org



Re: [SQL] BITMAP INDEXES...

2002-08-22 Thread Bruce Momjian


See the email about bitmapped indexes linked to from the TODO list item
on bitmaps.  Bitmap indexes allow arbitrary indexes to be combined into
a single index.  Btree indexes can not be combined.

---

Rajesh Kumar Mallah. wrote:
> Hi,
> 
> I have learnt from certain texts  that bitmap indexes are very useful for
> large DSS (decesion support systems).
> 
> bitmap indexes are currently not available in postgresql.
> 
> My question is in what way is a normal btree index in pgsql
> inferior to bitmap indexes (found in oracle for example).
> 
> is it just in terms of space requirements for performance too?
> 
> 
> regds
> mallah.
> 
> 
> -- 
> Rajesh Kumar Mallah,
> Project Manager (Development)
> Infocom Network Limited, New Delhi
> phone: +91(11)6152172 (221) (L) ,9811255597 (M)
> 
> Visit http://www.trade-india.com ,
> India's Leading B2B eMarketplace.
> 
> 
> 
> ---(end of broadcast)---
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])
> 

-- 
  Bruce Momjian|  http://candle.pha.pa.us
  [EMAIL PROTECTED]   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster