Hi Cedric,<div><br></div><div>thanks for the hint.</div><div>the problem with <meta charset="utf-8">SELECT 1 FROM yb_int_props; is that it returns ALL rows and interprets the "1" as column name (which does not exist) ;-)</div>
<div><br></div><div>so I just checked the statement:</div><div>select relname from pg_class where relname = 'yb_int_props';</div><div><br></div><div>this is super fast and I don't care that this is postgres specific for the moment :-)</div>
<div>I'll search now the class where this is used.</div><div><br></div><div>Thanks again!</div><div>Cheers</div><div>Balz<br><br><div class="gmail_quote">On Mon, May 2, 2011 at 10:43 AM, Cedric Staub <span dir="ltr"><<a href="mailto:cs.staub@cssx.ch">cs.staub@cssx.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi<br>
<div class="im"><br>
On Mon, May 02, 2011 at 09:41:57AM +0200, Balz Schreier wrote:<br>
> I have the following issue:<br>
> in our boost DB, we have two large tables (the nodes table and the table<br>
> where the number of hits are counted).<br>
><br>
> indexes are all there and the queries are fast (tested via postgres<br>
> command).<br>
><br>
> BUT: before the "java.sql.Connection" object can be used, it tests the<br>
> connection first to the DB, before the object is handed over to your code.<br>
<br>
</div>I'm not sure that's where it's coming from, are you sure it's not from<br>
the repository implementation?<br>
<div class="im"><br>
> The query looks like this: SELECT 1 FROM <tablename>;<br>
<br>
</div>That should be in order to check if <tablename> exists or not, as the<br>
query fails if the table doesn't exist but always succeeds if it does.<br>
It should be in the repository implementation somewhere if you'd like to<br>
change it.<br>
<div class="im"><br>
> the problem with that query is, that it takes 4 seconds (we have > 3 Mio.<br>
> rows in the tables).<br>
<br>
</div>Whoa, I never anticipated it would take this long (after all, it should<br>
only select a constant value). So I googled around a bit and found this<br>
for Postgres: <a href="http://www.peterbe.com/plog/pg_class" target="_blank">http://www.peterbe.com/plog/pg_class</a><br>
<br>
Not sure if the first query there is any faster, but the second one<br>
certainly has to be (altough it will break HSQLDB compatiblity).<br>
<br>
So this could still be coming from java.sql.Connection though... In that<br>
case, I wouldn't know how to change it.<br>
<br>
Cheers<br>
<font color="#888888">Cedric<br>
</font><br>--<br>
Yanel-development mailing list <a href="mailto:Yanel-development@wyona.com">Yanel-development@wyona.com</a><br>
<a href="http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development" target="_blank">http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development</a><br></blockquote></div><br></div>