Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with a query in Oracle
Message
General information
Forum:
Oracle
Category:
Troubleshooting
Miscellaneous
Thread ID:
00500038
Message ID:
00500584
Views:
14
Hi George!

I think that part of the problem is that I don´t *really* know the capabilities/speed of Oracle in querys that involve a lot of rows and different tables.

Currently I have this structure:

CREATE TABLE forum_areas (
ID VARCHAR2(32) NOT NULL UNIQUE,
name VARCHAR2(150) NOT NULL UNIQUE,
description VARCHAR2(1024) NOT NULL UNIQUE
);

CREATE TABLE forums (
ID VARCHAR2(32) NOT NULL UNIQUE,
areaID VARCHAR2(32) NOT NULL,
name VARCHAR2(150) NOT NULL,
description VARCHAR2(1024),
forumscript CHAR(1) NOT NULL,
emoticons CHAR(1) NOT NULL,
class CHAR(1) NOT NULL,
creationdate DATE
);

CREATE TABLE forum_posts (
ID VARCHAR(32) NOT NULL UNIQUE,
forumID VARCHAR(32) NOT NULL,
parentID VARCHAR(32) NOT NULL,
type(*) CHAR(1) NOT NULL,
title VARCHAR(128),
text CLOB NOT NULL,
author VARCHAR(32),
iconID VARCHAR(32),
forumscript CHAR(1) NOT NULL,
postdate DATE,
ip VARCHAR(32),
views NUMBER DEFAULT '0' NOT NULL,
rating NUMBER,
numrates NUMBER DEFAULT '0' NOT NULL
);

(*)A value of 'T' in type means a topic, a value of 'M' means a message/reply.

There is any user table. Everybody can post a topic/message. Now, I want to list the available forums and related info:

- Forum´s ID
- Forum´s area name
- Forum´s name
- Forum´s description
- Number of topics in the forum**
- Number of total post in the forum (topics+messages)**
- Last post (date)

(**)If I want to get this information, I have 2 (or more) options:
- Get in every query a count(*) of the number of topics/messages (nested querys, etc.)
- Creating 2 columns (number of topics and number of messages) in the forum table, and a trigger (or script coding) to update that information in the forum table every time a user posts a new topic/message.

My question is:
- I´m familiarized with MySQL and SQL Server, but not with Oracle. I don´t know his limits. Which of the previous possibilities is better? cpu-time/hd space/database structure.

Thanks!
Previous
Reply
Map
View

Click here to load this message in the networking platform