From: | Rajesh Kumar Mallah <mallah(at)trade-india(dot)com> |
---|---|
To: | Popeanga Marian <pmarian(at)cnlo(dot)ro> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: explain |
Date: | 2003-03-22 08:45:02 |
Message-ID: | 200303221415.02040.mallah@trade-india.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Sorry ,
I am not sure about this.
ie, if a query does not have enough previliegs to run,
will its explain be allowed?
i hope someone else can throw some light.
But i have one suggestion regarding your project
spend a *couple* of week studying docs and using postgresql.
just a quick weekend may not be enough to gather much
understanding for your project.
regds
mallah.
On Saturday 22 Mar 2003 11:41 am, Popeanga Marian wrote:
> Mallah,
>
>
> Thanks for your info,
>
>
> I runned the query with explain yesterday and it didn't work for
> a user where i didn't had enough privileges i think !?
> Why db didn't say anythink ?
>
> I created a new user and a new table.
>
> Explain for this table worked just as you said and for any other
> querys.
>
> Is there any way to know if a user has wright privileges to explain a
> query ?
>
> mallah(at)trade-india(dot)com wrote:
>
> >Popeanga ,
> >
> >Its basically possible to get the info programatically.
> >see below is an example perl code that is getting the
> >plan data:
> >
> >############### file test.pl #################
> >
> >#!/usr/bin/perl
> >
> >use DBI;
> >$dbh = DBI->connect('dbi:Pg:dbname=rmallah' , '','');
> >$your_query_here= 'select * from test';
> >$rows = $dbh -> selectall_arrayref("EXPLAIN ANALYZE $your_query_here");
> >foreach (@$rows) {
> > print "$_->[0]\n";
> >}
> >$dbh -> disconnect();
> >#############################################
> >
> >on running you get:
> >
> >[rmallah(at)subho rmallah]$ ./test.pl
> >Seq Scan on test (cost=0.00..20.00 rows=1000 width=32) (actual time=0.02..0.05 rows=11 loops=1)
> >Total runtime: 0.19 msec
> >
> >But be careful abt explain analyzing
> >queries that potentially modify data. (read more on docs of EXPLAIN)
> >we have to put the explain analyze in a transaction block which
> >shud eventually be rollbacked.
> >
> >now that you have seen how to get lines of output from EXPLAIN using/hadling this
> >data is upto you application.
> >
> >also note that the last like of EXPLAIN analyze carries the runtime.
> >
> >hope it helps
> >Mallah.
> >
> >
> >
> >
> >
> >
> >-----------------------------------------
> >Get your free web based email at trade-india.com.
> > "India's Leading B2B eMarketplace.!"
> >http://www.trade-india.com/
> >
> >
> >
> >
>
> --
> Popeanga Marian
> DBA Oracle
> CNLO Romania
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
>
--
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Popeanga Marian | 2003-03-22 08:45:44 | Re: SQL help for efficient time handling.. |
Previous Message | Rajesh Kumar Mallah | 2003-03-22 08:02:33 | SQL help for efficient time handling.. |