These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Nombre d'enregistrements d'une table
PostPosted: Fri Apr 14, 2006 8:14 am 
Newbie

Joined: Wed Mar 15, 2006 10:31 am
Posts: 5
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
3.1.3

Name and version of the database you are using:
Postgresql 8.1

Je cherche à obtenir le nombre d'enregistrement de deux table ( Ads et User ) celà représente environ 650 000 enregistrements.

Mes table sont composé de la façon suivante

| int id (P)| varchar(255) domainname |

J'avais pensé à une requête HQL :
"SELECT count(ads.id), count(useR.id) FROM User as user, Ads as ads"

Mais c'est très très très lent.

Y à t'il un autre moyen d'obtenir le nombre d'enregistrement d'une table plus rapidement ?

Merci !


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 15, 2006 3:06 am 
Newbie

Joined: Wed Mar 15, 2006 10:31 am
Posts: 5
Je m'auto-répond.

Mon HQL était erroné, je demandais tout les possibilité entre les deux table. Soit User puissance Ads, environ 2 et quelques milliards, d'où là lenteur...

Il falais faire deux requête "SELECT COUNT(*) FROM Ads AS ads" et "SELECT COUNT(*) FROM User ASs user"

Merci !


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.