Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3723272
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T06:12:36+00:00 2026-05-19T06:12:36+00:00

I have a site where some pages (we call them gateway pages) are based

  • 0

I have a site where some pages (we call them gateway pages) are based loosely on certain departments in the organization. Each department has classes associated with it. Unfortunately some of my pages are not associated with a specific department, but do display information about several classes from a department so I can’t just query the database strictly on department alone.

Would it be smarter to create a table called gateway_classes with a fk from the gateway table in each class or form a query to somehow filter out exactly what I need from my existing tables using an array of classes to be pulled during the query?

Here’s my tables:
departments_classes | classes_vendors | departments | vendors | classes | products | gateway

Any guidance is greatly appreciated.

More Info: There are roughly 350 classes and 18 departments and 12 gateway pages…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T06:12:37+00:00Added an answer on May 19, 2026 at 6:12 am

    Your indexing table idea sounds like it’d work just fine. The only downside to that is that you’ve got to maintain it separately, and you want to make sure that the data you hold in that table isn’t being duplicated in any of your existing tables.

    If you don’t want to maintain that data differently than you’re currently doing so, you can use CF’s arrays (or structs) to hold that correlation data (which you’d have to pull from the db in a separate query) and then loop over it as you construct the query that pulls the classes for a given page.

    Either way would work okay, it’s more a matter of how you prefer to do it, and what you think would be easiest to build, test, and maintain.

    One thing about efficiency – make sure you not only link your tables via Foreign Keys (which helps to maintain data integrity), but also put in (nonclustered) indices, which helps the efficiency of the joins and lookups your queries will be doing.

    I’ve seen dramatic speed improvements in my queries (CFQUERYs operating against MS SQL) with the simple act of putting in indices.

    In MS SQL, you do so like this:

    CREATE NONCLUSTERED INDEX yourIndexName ON yourTableName(yourFieldName)
    

    I hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a site, which has some static pages. Like explore, home, feedback.
I have several pages, let's call them A, B and C. Each of these
I have a site that features some pages which do not require any post-back
I have a site in Joomla, and some pages can be cached for some
I have a website with multiple pages, each of them with custom event handlers
On my site: http://alsite.com.br/solalev/ I have some elements on the bottom of page that
I have some site where I am embedding a couple of youtube videos in
I have public site with some forms. Simple question: What kind of informations should
I have a site where some users will be registered by our staff, and
We have a site that is serving some RSS feeds, and we'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.